Advertisement
AndriikoM

Лекція 2, завдання 4

Oct 30th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7.     int a;
  8.     int b=0;
  9.     int c;
  10.     int d;
  11.     cout << "vvedit' vysotu yalynky:";
  12.     cin >> a;
  13.         while (b<a)
  14.         {
  15.             c=a-b;
  16.             while (c>0)
  17.             {
  18.                 cout << " ";
  19.                 c--;
  20.             }
  21.             d=0;
  22.             while (d<2*b+1)
  23.             {
  24.                 cout << "*";
  25.                 d++;
  26.             }
  27.             cout<< endl;
  28.             b++;
  29.         }
  30.  
  31.         while (a>0)
  32.             {
  33.                 cout << " ";
  34.                 a--;
  35.             }
  36.             cout << "*";
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement