Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int determining_maximum(int Rad_quantity , int stars[])
- {
- int careht=0;
- int makcimym=0;
- while(careht<Rad_quantity)
- {
- if (makcimym <= stars[careht])
- {
- makcimym=stars[careht];
- }
- careht++;
- }
- return makcimym;
- }
- void output_symbol (int p ,int w)
- {
- int careht=0;
- while(careht<p)
- {
- cout << " " ;
- careht++;
- }
- careht=0;
- while(careht<w)
- {
- cout << "*" ;
- careht++;
- }
- cout << endl;
- }
- void output(int Rad_quantity,int stars[])
- {
- int makcimym=determining_maximum ( Rad_quantity, stars ) ;
- int careht_1=0;
- while(careht_1<Rad_quantity)
- {
- output_symbol((makcimym-stars[careht_1])/2, stars[careht_1]);
- careht_1++;
- }
- }
- int main()
- {
- int stars[20];
- int careht=0;
- int Vremina=1;
- stars[0]=1;
- while(Vremina!=0)
- {
- cin >> Vremina ;
- stars[careht]=Vremina ;
- careht++;
- }
- output(careht,stars);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement