Advertisement
dimon-torchila

Untitled

Mar 9th, 2022
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int first = 0, second = 1, k;
  6.     cin >> k;
  7.     while (k != 0) {
  8.         first += second;
  9.         second = first - second;
  10.         cout << first << ' ';
  11.         --k;
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement