Advertisement
Lucky134Lucky

Massive.C

Feb 9th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int higher(int []);
  5. void vivod(int, int []);
  6. int main()
  7. {
  8.    int j;
  9.     int mass[10] = { } ;
  10.     for(int i = 0; i < 10; i ++){
  11.         cin>>j;
  12.         mass[i] = j;
  13.         if (j==0) break;
  14.     }
  15.      int v = higher(mass);
  16.      vivod(v, mass);
  17.     return 0;
  18. }
  19. int higher(int n[]) {
  20.     int z = 0;
  21.     for (int s = 0; s < 10; s++) {
  22.         if (n[s]>z) z = n[s];
  23.     }
  24.     return z;
  25. }
  26. void vivod(int u, int ja[])
  27. {
  28.          for (int a1 = 0; a1 < 10; a1++){
  29.             if (u != ja[a1]) {
  30.                 for (int s1 = 1; s1 <= (u-ja[a1])/2 ; s1++){
  31.                     cout<<" ";
  32.                 }
  33.             }
  34.             for (int s2 = 0; s2<ja[a1]; s2 ++){
  35.                 cout<<"*";
  36.             }
  37.             cout<<endl;
  38.          }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement