HDU/2019/main.c
Saturneric 0525ffad24 Add.
2020-09-01 00:48:58 +08:00

26 lines
417 B
C

#include <stdio.h>
int main(void){
int n,m;
int ac[100];
while(scanf("%d %d",&n,&m) == 2){
if(!m && !n) continue;
int i, index = 0;
for(i = 0; i < n; i++){
scanf("%d",&ac[i]);
if(m > ac[i]) index++;
}
if(!index) printf("%d ",m);
for(i = 0; i < n; i++){
if(i) printf(" ");
printf("%d",ac[i]);
if(i == index-1) {
printf(" %d",m);
}
}
printf("\n");
getchar();
}
return 0;
}