fork(1) download
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. int main() {
  5.  
  6. int N, F = 0, F_1 = 1, F_2 = 0;
  7. cin >> N;
  8. for (int i = 1; i <= N; i++) {
  9. F = F_2 + F_1;
  10. F_2 = F_1;
  11. F_1 = F;
  12. cout << F;
  13.  
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5316KB
stdin
8
stdout
12358132134