Advertisement
Guest User

Функции елочки

a guest
Dec 17th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int Zapros(int &a){
  5.     cout << "Vvedite rasmer elochki:";
  6.     cin >> a;
  7. }
  8. void Budivelnik(int b,int f){
  9.     int c = 0;
  10.     int g = b;
  11.     int e = 1;
  12.     c = e;
  13.     while(b > f)
  14.     {
  15.         while(g > 0)
  16.         {
  17.         cout << " ";
  18.         g--;
  19.         }
  20.         c = e;
  21.         while(c > 0)
  22.         {
  23.             cout << "*";
  24.             c--;
  25.         }
  26.         e = e + 2;
  27.         f++;
  28.         g = b - f;
  29.         cout << endl;
  30.     }
  31.     f = 0;
  32.     while(b > f)
  33.     {
  34.         cout << " ";
  35.         f++;
  36.     }
  37.     cout << "*";
  38. }
  39. int main()
  40. {
  41.     int index = 0,kolichestvo = 0;
  42.     Zapros(kolichestvo);
  43.     Budivelnik(kolichestvo,index);
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement