Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- unsigned input;
- int i;
- int fb(int a)
- {
- int tab[a];
- cout << "0";
- tab[0] = 0;
- cout << "1";
- tab[1] = 1;
- for (i=2;i<a;i++)
- {
- tab[i] = tab[i-1] + tab[i-2];
- cout << i << ". " << tab[i] << endl;
- }
- }
- int main()
- {
- cout << "podaj ile wyrazow ciagu chcesz wyswietlic: ";
- cin >> input;
- fb(input);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement