Josif_tepe

Untitled

Feb 9th, 2026
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.    
  9.     int F = 1, S = 1;
  10.    
  11.     cout << F << endl;
  12.     cout << S << endl;
  13.    
  14.     while(F + S <= n) {
  15.         int T = F + S;
  16.        
  17.         cout << T << endl;
  18.        
  19.         F = S;
  20.         S = T;
  21.     }
  22.    
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment