Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int n;
- int arr[100];
- NhapLai:
- cin >> n;
- if (n <= 2 && n >= 92)
- {
- goto NhapLai;
- }
- arr[0] == 0; arr[1] = 1;
- for (int i = 2; i <= n - 1; i++)
- {
- arr[i] = arr[i - 1] + arr[i - 2];
- }
- for (int i = 0; i <= n - 1; i++)
- {
- cout << arr[i] << " ";
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement