bingxuan9112

debugB

Apr 9th, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int n;
  8. vector<int> a;
  9. int main(){
  10.     while(cin >> n){
  11.         for(int i = 0;i < n;i++)cin >> a[i];
  12.         sort(a.begin(),a.end());
  13.         cout << a[0]; 
  14.         for(int i = 1;i < n;i++)cout << ' ' << a[i];
  15.         cout << endl;
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment