Advertisement
evgenko

Untitled

Jun 5th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 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.             break;
  23.         }
  24.  
  25.     }
  26. }
  27. void vivod_simvola(int n,char b)
  28. {
  29.     for (int i=0;i<n;i++)
  30.         cout<<b;
  31. }
  32. int main()
  33. {
  34.     int chisla[1000];
  35.     bool block=false;// block vvoda
  36.     int vvchislo;
  37.     int chetchik=0;
  38.     int max=0;
  39.     int kolprob;
  40.     vvod_chisel(chisla,max,chetchik);
  41.     kolprob=max/2+1;
  42.     for (int i=0;i<chetchik;i++)
  43.     {
  44.         max=kolprob-0.5*chisla[i];
  45.         vivod_simvola(max,' ');
  46.         vivod_simvola(chisla[i],'*');
  47.         cout<<endl;
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement