Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ch04q12()
- {
- const int SIZE = 4 ;
- int num[SIZE] ;
- int max = 0 ;
- int i , k , j ;
- cout << "Please insert 4 numbers using space --> " ;
- for(i=0;i<SIZE;i++)
- {
- cin >> num[i] ;
- if(num[i]>max)
- max = num[i] ;
- }
- cout << endl ;
- for(i=0;i<SIZE+8;i++)
- cout << "-" ;
- cout << endl ;
- k = max ;
- for(i=0;i<max;i++)
- {
- for(j=0;j<SIZE;j++)
- {
- if(num[j] >= k )
- {
- cout << "*" ;
- }
- else
- cout << " " ;
- cout << " " ;
- }
- k-- ;
- cout << endl ; // Hight
- }
- for(i=0;i<SIZE+8;i++)
- cout << "-" ;
- cout << endl ;
- for(i=0;i<SIZE;i++)
- cout << num[i] << " " ;
- cout << endl << endl ;
- system("pause") ;
- system("cls") ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement