Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a[7]={2,5,7,3,6,7,1};
- int b[10];
- for (int i=0;i<10;i++){
- b[i]=0;
- }
- for (int i=0;i<7;i++){
- int ind=a[i];
- b[ind]+=1;
- }
- for(int j=0;j<10;j++){
- for(int k=0;k<b[j];k++){
- cout<<j<<" ";
- }
- }
- }
Add Comment
Please, Sign In to add comment