Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int i, j, b, r, m, ma;
- int a[5];
- b=0;
- i=0;
- while(i < 5){
- cout << i+1 << " :";
- cin >> a[i];
- i++;
- }
- i=0;
- r=1;
- m=0;
- ma = a[0];
- while(i < 5){
- if(ma < a[i+1]){
- ma = a[i+1];
- }
- i++;
- }
- while(b < ma){
- while(m < 5){
- if(a[i] >= r){
- cout << "*";
- }
- else{
- cout << " ";
- }
- i++;
- m++;
- }
- cout << endl;
- m=0;
- r++;
- b++;
- i=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement