#include<bits/stdc++.h>
using namespace std;
int main(){
int m, n, a, b, gary, temp;
scanf("%d %d %d %d %d", &m, &n, &a, &b, &gary);
for (int i = 0; i < m; i++){
for (int j = 0; j < n; j++){
cin >> temp;
if (temp >= a && temp <= b){
temp = gary;
}
if (j != 0){
cout << " ";
}
printf("%03d", temp);
}
cout << endl;
}
return 0;
}
PAT/1066 图像过滤
最新推荐文章于 2026-01-07 18:44:27 发布
这篇文章展示了如何使用C++编写一个程序,通过用户输入在给定矩阵范围内更新特定值。代码中包含两个嵌套循环,以及条件判断以实现这个功能。
586

被折叠的 条评论
为什么被折叠?



