Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int higher(int []);
- void vivod(int, int []);
- int main()
- {
- int j;
- int mass[10] = { } ;
- for(int i = 0; i < 10; i ++){
- cin>>j;
- mass[i] = j;
- if (j==0) break;
- }
- int v = higher(mass);
- vivod(v, mass);
- return 0;
- }
- int higher(int n[]) {
- int z = 0;
- for (int s = 0; s < 10; s++) {
- if (n[s]>z) z = n[s];
- }
- return z;
- }
- void vivod(int u, int ja[])
- {
- for (int a1 = 0; a1 < 10; a1++){
- if (u != ja[a1]) {
- for (int s1 = 1; s1 <= (u-ja[a1])/2 ; s1++){
- cout<<" ";
- }
- }
- for (int s2 = 0; s2<ja[a1]; s2 ++){
- cout<<"*";
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement