Problem : 2016 ( 数据的交换输出 ) Judge Status : Accepted
RunId : 6000635 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
RunId : 6000635 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h> 2 int main() 3 { 4 int n,seq[101],min,i,idx; 5 while (scanf("%d",&n),n) 6 { 7 min=0x3f3f3f3f; 8 for(i=0;i<n;i++) 9 { 10 scanf("%d",&seq[i]); 11 if(seq[i]<min) 12 { 13 min=seq[i]; 14 idx=i; 15 } 16 } 17 seq[idx]=seq[0]; 18 printf("%d",min); 19 for(i=1;i<n;i++) printf(" %d",seq[i]); 20 printf("\n"); 21 } 22 return 0; 23 }