kilolilo

Untitled

Oct 12th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a[7]={2,5,7,3,6,7,1};
  8.     int b[10];
  9.     for (int i=0;i<10;i++){
  10.         b[i]=0;
  11.     }
  12.     for (int i=0;i<7;i++){
  13.         int ind=a[i];
  14.         b[ind]+=1;
  15.     }
  16.     for(int j=0;j<10;j++){
  17.         for(int k=0;k<b[j];k++){
  18.          cout<<j<<" ";
  19.         }
  20.     }
  21. }
Add Comment
Please, Sign In to add comment