-
Notifications
You must be signed in to change notification settings - Fork 2
/
B1066.cpp
35 lines (32 loc) · 963 Bytes
/
B1066.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*************************************************************************
> File Name: B1066.cpp
> Author: bumzy
> Mail: [email protected]
> Created Time: 2017年07月30日 星期日 17时38分01秒
************************************************************************/
#include <stdio.h>
using namespace std;
const int MAXN = 500 + 10;
int matrix[MAXN][MAXN];
int main(void) {
int m, n, low, high, replace;
scanf("%d%d%d%d%d", &m, &n, &low, &high, &replace);
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
scanf("%d", &matrix[i][j]);
if (matrix[i][j] >= low && matrix[i][j] <= high) {
matrix[i][j] = replace;
}
}
}
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
printf("%03d", matrix[i][j]);
if (j < n - 1) {
printf(" ");
}
}
printf("\n");
}
return 0;
}