Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h> 2 int main() 3 { 4 int n,x,seq[105],i,f; 5 while (scanf("%d%d",&n,&x),n||x) 6 { 7 f=0; 8 for (i=0;i<n;i++) 9 { 10 scanf("%d",&seq[i]); 11 if(seq[i]>x&&f==0) 12 { 13 printf("%d ",x); 14 f=1; 15 } 16 printf("%d",seq[i]); 17 if(i!=n-1) printf(" "); 18 } 19 printf("\n"); 20 } 21 return 0; 22 }
本文转自ZH奶酪博客园博客,原文链接:http://www.cnblogs.com/CheeseZH/archive/2012/05/26/2518947.html,如需转载请自行联系原作者