daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.  
  4. #include<iostream>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     int n;
  12.     int arr[100];
  13.  
  14. NhapLai:
  15.     cin >> n;
  16.  
  17.     if (n <= 2 && n >= 92)
  18.     {
  19.         goto NhapLai;
  20.     }
  21.     arr[0] == 0; arr[1] = 1;
  22.     for (int i = 2; i <= n - 1; i++)
  23.  
  24.     {
  25.         arr[i] = arr[i - 1] + arr[i - 2];
  26.     }
  27.  
  28.     for (int i = 0; i <= n - 1; i++)
  29.     {
  30.         cout << arr[i] << " ";
  31.     }
  32.  
  33.     system("pause");
  34.  
  35.     return 0;
  36.  
  37.  
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top