Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <stdio.h>
- #include <iostream>
- using namespace std;
- int main(int argc, char** argv) {
- int a=1, b=0, c, step;
- while(c<20) {
- if(step == 0) {
- cout << a << " ";
- step++;
- } else {
- c = a+b;
- b = a;
- a = c;
- cout << c << " ";
- }
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement