Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int num, a;
- cout<<"Podaj poczatkowa wartosc ciagu"<<endl;
- cin>>a;
- cout << "Podaj dlugosc ciagu : ";
- cin >> num;
- int x = 0, y = a, z = 0;
- for (int i = 0; i < num; i++) {
- if (x != 0)
- {
- cout << x << endl;
- }
- z = x + y;
- x = y;
- y = z;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement