Advertisement
MeehoweCK

Untitled

May 10th, 2023
746
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. /* zakresy wartości przechowywanych przez zmienne:
  6.  
  7. short:              od -32 768 do 32 767
  8. unsigned short:     od 0 do 65 535
  9.  
  10. int:                od -2 147 483 648 do 2 147 483 647
  11. unsigned int:       od 0 do 4 294 967 295
  12.  
  13. long long:          od od -9 223 372 036 854 775 808 do 9 223 372 036 854 775 807
  14. unsigned long long: od 0 do 18 446 744 073 709 551 615
  15.  
  16. */
  17.  
  18. int main()
  19. {
  20.     int n;
  21.     unsigned long long a, b = 1, c = 0;
  22.     cout << "Podaj liczbe naturalna: ";
  23.     cin >> n;
  24.  
  25.     for(int i = 0; i < n; ++i)
  26.     {
  27.         a = b;
  28.         b = c;
  29.         c = a + b;
  30.         cout << c << ' ';
  31.     }
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement