Guest User

Untitled

a guest
Jun 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<vector>
  3. #include<iostream>
  4. #include<algorithm>
  5. #include<stdlib.h>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     int n,j;
  12.     while(cin>>n)
  13.     {
  14.         if(n==0)
  15.         {
  16.             return 0;
  17.         }
  18.         else {
  19.             vector<int>v;
  20.  
  21.             for(int i=0;i<n;i++)
  22.             {
  23.                 cin>>j;
  24.                 v.push_back(j);
  25.             }
  26.             sort(v.begin(),v.end());
  27.             for(int i=0;i<v.size();i++)
  28.             {
  29.             cout<<v[i]<<" ";
  30.             }
  31.             cout<<"\n";
  32.         }
  33.     }
  34.  
  35. return 0;
  36.  
  37. }
Add Comment
Please, Sign In to add comment