标签:bottom put 排序 ssi sam script ott limit --
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 145410 Accepted Submission(s): 53585
1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 5 int main() 6 { 7 int a[1000],n,i; 8 while(cin>>n&&n!=0) 9 { 10 int mintemp=0,minvalue; 11 for(i=0;i<n;i++) 12 { 13 cin>>a[i]; 14 if(i==0)minvalue=a[i]; 15 if(a[i]<minvalue) 16 { 17 minvalue=a[i]; 18 mintemp=i; 19 } 20 } 21 i=a[mintemp]; 22 a[mintemp]=a[0]; 23 a[0]=i; 24 cout<<a[0]; 25 for(i=1;i<n;i++) 26 { 27 cout<<" "<<a[i]; 28 } 29 cout<<endl; 30 } 31 }
标签:bottom put 排序 ssi sam script ott limit --
原文地址:https://www.cnblogs.com/lightice/p/10261178.html