forked from alexhuangster/csapp3e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostit.c
55 lines (47 loc) · 903 Bytes
/
postit.c
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* $begin postitdata */
struct point_color {
int c;
int m;
int y;
int k;
};
struct point_color square[16][16];
int i, j;
/* $end postitdata */
void loops()
{
/* $begin postitloop1 */
for (i = 0; i < 16; i++){
for (j = 0; j < 16; j++) {
square[i][j].c = 0;
square[i][j].m = 0;
square[i][j].y = 1;
square[i][j].k = 0;
}
}
/* $end postitloop1 */
/* $begin postitloop2 */
for (i = 0; i < 16; i++){
for (j = 0; j < 16; j++) {
square[j][i].c = 0;
square[j][i].m = 0;
square[j][i].y = 1;
square[j][i].k = 0;
}
}
/* $end postitloop2 */
/* $begin postitloop3 */
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
square[i][j].y = 1;
}
}
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
square[i][j].c = 0;
square[i][j].m = 0;
square[i][j].k = 0;
}
}
/* $end postitloop3 */
}