Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void naricuiSpase(int str[], int Max, int i)
- {
- for (int t = 0; t < (Max - str[i]) / 2; t++)
- {
- cout << " ";
- }
- }
- void narisuiZvezdy(int str[], int i)
- {
- for (int f = 0; str[i] > f; f++)
- {
- cout << "*";
- }
- }
- void naricuiFigyry(int str[], int Max, int kolichestvoStrok)
- {
- for(int i = 0; i < kolichestvoStrok; i++)
- {
- naricuiSpase(str, Max, i);
- narisuiZvezdy(str, i);
- cout<< endl;
- }
- }
- int vuchecliMax( int str[] )
- {
- int Max = 0;
- for(int j = 0; str[j] != 0; j++)
- {
- if(str[j] > Max)
- {
- Max = str[j];
- }
- }
- return Max;
- }
- int main()
- {
- int i = 0;
- int str[20];
- while(i < 20)
- {
- cout << "skolbko zvezd ctroke " << i + 1 <<", tolbko chotnue chisla, pishu 0 = konec, ili 20-e konec ";
- cin >> str[i];
- if(str[i] == 0)
- {
- break;
- }
- i++;
- }
- naricuiFigyry(str, vuchecliMax(str), i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement