Advertisement
Ro_ro400_

Untitled

Jan 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int determining_maximum(int Rad_quantity , int stars[])
  6. {
  7.     int careht=0;
  8.     int makcimym=0;
  9.     while(careht<Rad_quantity)
  10.     {
  11.         if (makcimym <= stars[careht])
  12.  
  13.         {
  14.             makcimym=stars[careht];
  15.         }
  16.         careht++;
  17.     }
  18.     return makcimym;
  19. }
  20.  
  21. void output_symbol (int p ,int w)
  22. {
  23.     int careht=0;
  24.     while(careht<p)
  25.     {
  26.         cout << " " ;
  27.         careht++;
  28.     }
  29.     careht=0;
  30.     while(careht<w)
  31.     {
  32.         cout << "*" ;
  33.         careht++;
  34.     }
  35.     cout << endl;
  36. }
  37.  
  38. void output(int Rad_quantity,int stars[])
  39. {
  40.     int makcimym=determining_maximum ( Rad_quantity, stars ) ;
  41.     int careht_1=0;
  42.     while(careht_1<Rad_quantity)
  43.     {
  44.         output_symbol((makcimym-stars[careht_1])/2, stars[careht_1]);
  45.         careht_1++;
  46.     }
  47. }
  48.  
  49. int main()
  50. {
  51.     int stars[20];
  52.     int careht=0;
  53.     int Vremina=1;
  54.     stars[0]=1;
  55.     while(Vremina!=0)
  56.     {
  57.         cin >> Vremina ;
  58.         stars[careht]=Vremina ;
  59.         careht++;
  60.     }
  61.     output(careht,stars);
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement