标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 53368 Accepted Submission(s): 22939
1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 using namespace std; 5 int main(){ 6 int test, n; 7 cin >> test; 8 9 while(test--) 10 { 11 vector<int> v; 12 cin >> n; 13 for(int i = 0; i < n; i++) 14 { 15 int temp; 16 cin >> temp; 17 v.push_back(temp); 18 } 19 sort(v.begin(), v.end()); 20 for(int i = 0; i < n; i++) 21 { 22 if(i == 0) 23 cout << v[i]; 24 else 25 cout << " " << v[i]; 26 } 27 cout << endl; 28 } 29 return 0; 30 }
标签:
原文地址:http://www.cnblogs.com/qinduanyinghua/p/5518265.html