數列有序!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 46456 Accepted Submission(s): 20061
#include <stdio.h> int main() { int n,m,a[102],i; while (scanf("%d%d",&n,&m)!=EOF&&(m||n)) { for (i=0;i<n;i++) scanf("%d",&a[i]); for (i=0;i<n;i++) if (a[i]<m) printf("%d ",a[i]); else break; printf("%d",m); for (;i<n;i++) printf(" %d",a[i]); printf("\n"); } return 0; }簡單插入