This commit is contained in:
xice09
2018-08-01 02:30:29 +08:00
parent 36f2ab51ab
commit cc6cf4cdea
10 changed files with 261 additions and 0 deletions

32
2019.cpp Normal file
View File

@@ -0,0 +1,32 @@
#include <iostream>
using namespace std;
int main(){
int n,x;
while (cin >> n >>x && (n!=0||x!=0)){
int *i = new int[n];
int *hea = i;
for(int j=0;j<n;j++)
cin >> i[j];
int j=0;
for(;j<n;j++){
if(i[j] > x){
cout << x << ' ';
break;
}
cout << i[j] << ' ';
}
if(j==n){
cout << x << endl;
} else
for(;j<n;j++){
cout << i[j];
if(j==n-1)
cout << endl;
else
cout << ' ';
}
delete[]i;
}
return 0;
}