Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- /* zakresy wartości przechowywanych przez zmienne:
- short: od -32 768 do 32 767
- unsigned short: od 0 do 65 535
- int: od -2 147 483 648 do 2 147 483 647
- unsigned int: od 0 do 4 294 967 295
- long long: od od -9 223 372 036 854 775 808 do 9 223 372 036 854 775 807
- unsigned long long: od 0 do 18 446 744 073 709 551 615
- */
- int main()
- {
- int n;
- unsigned long long a, b = 1, c = 0;
- cout << "Podaj liczbe naturalna: ";
- cin >> n;
- for(int i = 0; i < n; ++i)
- {
- a = b;
- b = c;
- c = a + b;
- cout << c << ' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement