Advertisement
Guest User

Untitled

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