Advertisement
ZhilinskiyG

Task 2_09

Feb 29th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n, i = 1, s = 0; //i - счетчик строк, номер строки
  7.     cin >> n; // n - высота пирамиды
  8.     while (i <= n) {
  9.         s = 0; // s - счетчик выведенных звездочек на данной строке
  10.         while (s < i) {
  11.             cout << "*";
  12.             ++s;
  13.         }
  14.         cout << endl;
  15.         ++i;
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement