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