标签:nbsp str namespace std out -- turn using while
#include<iostream>
#include<cmath>
#include<iomanip>
#include<algorithm>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
for(int i =0 ;i<n;i++){
int c;
cin>>c;
a[i] = c;
}
for(int i=0;i<n;i++){
for(int j=i;j<n;j++){
int tem;
if(a[i]>a[j]){
tem = a[j];
a[j]=a[i];
a[i]=tem;
}
}
}
for(int i =0 ;i<n;i++){
cout<<a[i]<<endl;
}
}
return 0;
}
#include<iostream>
#include<cmath>
#include<iomanip>
#include<algorithm>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
for(int i =0 ;i<n;i++){
int c;
cin>>c;
a[i] = c;
}
sort( a,a+n, less<int>() );
for(int i=0;i<n;i++){
cout<<a[i]<<endl;
}
}
return 0;
}
标签:nbsp str namespace std out -- turn using while
原文地址:http://www.cnblogs.com/sysu-eeman-yang/p/6103763.html