标签:des style blog color io java strong for 数据
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 55551 Accepted Submission(s):
21128
1 #include<cstdio> 2 int main() 3 { 4 int n,a[100]={0}; 5 while(scanf("%d",&n)==1) 6 { 7 if(n==0||n>99)return 0; 8 int mins=10000,t,i; 9 for(i=0;i<n;i++) 10 { 11 scanf("%d",&a[i]); 12 if(mins>a[i]){mins=a[i];t=i;} 13 } 14 mins=a[0];a[0]=a[t];a[t]=mins; 15 for(n=0;n<i-1;n++)printf("%d ",a[n]); 16 printf("%d\n",a[n]); 17 } 18 return 0; 19 }
标签:des style blog color io java strong for 数据
原文地址:http://www.cnblogs.com/The-courage-that-year/p/3993577.html