Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int s = 5;
  8.     int a[s];
  9.     int cntr, cntr2, maxi = 0;
  10.     cntr = 0;
  11.     while(cntr < s){
  12.         cout << "zvezdochek v " << cntr + 1 << " stolbike: ";
  13.         cin >> a[cntr];
  14.         cntr++;
  15.     }
  16.     cntr = 0;
  17.     while(cntr < s){
  18.         if(maxi < a[cntr]){
  19.             maxi = a[cntr];
  20.         }
  21.         cntr++;
  22.     }
  23.     cntr = 0;
  24.     while(cntr < maxi){
  25.         cntr2 = 0;
  26.         while(cntr2 < s){
  27.             if(cntr < a[cntr2]){
  28.                 cout << "*";
  29.             }
  30.             else{
  31.                 cout << " ";
  32.             }
  33.         cntr2++;
  34.         }
  35.     cout << endl;
  36.     cntr++;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement