Advertisement
evgenko

Untitled

Jun 5th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. void vvod_chisel(int a[],int&max, int&chetchik)
  5. {
  6.     bool block=false;
  7.     for (int i=0; i<=1000; i++)
  8.     {
  9.         if (block==false)
  10.         {
  11.             cout << "vvedite chislo: ";
  12.             chetchik++;
  13.             cin >> a[i];
  14.             if (a[i]>max)
  15.             {
  16.                 max=a[i];
  17.             }
  18.         }
  19.         if (a[i]==0)
  20.         {
  21.             block=true;
  22.         }
  23.  
  24.     }
  25. }
  26. void cikil(int n,char b)
  27. {
  28.     for (int i=0;i<n;i++)
  29.         cout<<b;
  30. }
  31. int main()
  32. {
  33.     int chisla[1000];
  34.     bool block=false;// block vvoda
  35.     int vvchislo;
  36.     int chetchik=0;
  37.     int max=0;
  38.     int kolprob;
  39.     vvod_chisel(chisla,max,chetchik);
  40.     kolprob=max/2+1;
  41.     for (int i=0;i<chetchik;i++)
  42.     {
  43.         max=kolprob-0.5*chisla[i];
  44.         cikil(max,' ');
  45.         cikil(chisla[i],'*');
  46.         cout<<endl;
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement