Advertisement
Lucky134Lucky

Masive.Bonus

Feb 9th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5. void vivod(int[], int);
  6. int main()
  7. {
  8.    int mass[3] = {3, 0, 1};
  9.    int mass1[4] = {2, 0, 0, 1};
  10.    int mass2[4] = {2, 0, 0 };
  11.    int mass3[4] = {0, 1, 0};
  12.    vivod(mass, 3);
  13.    cout<<endl;
  14.    vivod(mass1, 4);
  15.    cout<<endl;
  16.    vivod(mass2, 4);
  17.    cout<<endl;
  18.    vivod(mass3, 4);
  19. }
  20. void vivod(int j[], int r) {
  21.      for (int z = 0; z < r; z++){
  22.             if (j[z]>0) {
  23.         for (int k = 0; k< j[z]; k++) {
  24.             cout<<"*";
  25.         }
  26.             }
  27.             else cout<<" ";
  28.      }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement