回答編集履歴

1

コードの修正

2021/12/15 00:37

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -34,19 +34,19 @@
34
34
 
35
35
  {
36
36
 
37
- char A[10][10], *p = A[0], *q = p + 10*10, *pa, *pb;
37
+ char A[10][10], *p = A[0], *pe = p + 10*10, *pa = p + 1, *pb = p;
38
38
 
39
- for (pa = pb = p + 10; p < q; pa += 9, pb += 10) {
39
+ while (p < pe) {
40
40
 
41
- while (p < pa) *p++ = 'A';
41
+ for (pa += 9; p < pa; ) *p++ = 'A';
42
42
 
43
- while (p < pb) *p++ = 'B';
43
+ for (pb += 10; p < pb; ) *p++ = 'B';
44
44
 
45
- }
45
+ }
46
46
 
47
- for (p -= 10*10; p < q; p += 10)
47
+ for (p -= 10*10; p < pe; p += 10)
48
48
 
49
- printf("%.10s\n", p);
49
+ printf("%.10s\n", p);
50
50
 
51
51
  }
52
52