TheRasVa

Задача 2,7

Feb 14th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. // ConsoleApplication3.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     int i, n, a, b, c;
  12.     i = 0;
  13.     a = 0;
  14.     b = 1;
  15.     c = 0;
  16.     cin >> n;
  17.     do
  18.     {
  19.         c = a + b;
  20.         b = a;
  21.         a = c;
  22.         cout << c;
  23.         cout << endl;
  24.         i++;
  25.     } while (i < n);
  26.     cout << endl;
  27.     system("PAUSE");
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment