标签:des style blog io color for sp 数据 div
1 #include <stdio.h> 2 3 int main(){ 4 int T; 5 int n; 6 int i; 7 int min; 8 int min_flag; 9 int number[11]; 10 11 scanf("%d",&T); 12 13 while(T--){ 14 scanf("%d",&n); 15 16 for(i=0;i<n;i++){ 17 scanf("%d",&number[i]); 18 19 if(i==0){ 20 min=number[0]; 21 min_flag=0; 22 } 23 24 if(number[i]<min){ 25 min=number[i]; 26 min_flag=i; 27 } 28 } 29 30 for(i=0;i<n;i++){ 31 if(i!=min_flag){ 32 min=number[i]; 33 break; 34 } 35 } 36 37 for(i=0;i<n;i++){ 38 if(i!=min_flag && number[i]<min) 39 min=number[i]; 40 } 41 42 printf("%d\n",min); 43 } 44 45 return 0; 46 }
标签:des style blog io color for sp 数据 div
原文地址:http://www.cnblogs.com/zqxLonely/p/4055021.html