#include<iostream>
#include <iomanip>
#include <cstdio>
#include<string>
#include<vector>
#include<array>
#include<math.h>
#include <ctype.h>
#include<algorithm>
#include <set>
using namespace std;
int main()
{
int a, b, c, d, e,i,j,x;
scanf("%d %d %d %d %d", &a, &b, &c, &d,&e);
//cin >> a >> b >> c >> d >> e;
for (i = 0; i < a; i++)
{
for (j = 0; j < b; j++)
{
scanf("%d", &x);
//cin >> x;
if (x >= c && x <= d)
{
x = e;
}
printf("%03d", x);
if (j != b-1)
cout << " ";
}
printf("\n");
}
return 0;
}
本文档展示了如何通过C++编程实现输入值在特定区间内的快速修改,使用scanf函数配合条件判断,提高代码效率。着重讲解了for循环遍历和if语句的应用,适合初学者理解基本的输入处理技巧。
582

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



