質問編集履歴
1
%bを削除しました。きれいに書いてみました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
```
|
5
|
+
```c言語
|
6
6
|
|
7
7
|
#include <stdio.h>
|
8
8
|
|
9
|
-
int main(void)
|
9
|
+
int main(void)
|
10
|
+
|
11
|
+
{
|
10
12
|
|
11
13
|
int n = 0;
|
12
14
|
|
@@ -14,21 +16,31 @@
|
|
14
16
|
|
15
17
|
char str[1000] = "ABCDE";
|
16
18
|
|
17
|
-
|
19
|
+
|
18
20
|
|
19
21
|
scanf("%d",&n);
|
20
22
|
|
21
|
-
|
22
23
|
|
23
|
-
for (i = 0; i < n; i++){
|
24
24
|
|
25
|
-
i
|
25
|
+
for (i = 0; i < n; i++)
|
26
26
|
|
27
|
-
|
27
|
+
{
|
28
28
|
|
29
|
-
|
29
|
+
if(i < n)
|
30
30
|
|
31
|
+
{
|
32
|
+
|
33
|
+
printf("%s",str);
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
else if(i == 0) //ヌル文字と一致したら改行のつもり。
|
38
|
+
|
39
|
+
{
|
40
|
+
|
31
|
-
printf("%s\n",str);
|
41
|
+
printf("%s\n",str);
|
42
|
+
|
43
|
+
}
|
32
44
|
|
33
45
|
}
|
34
46
|
|
@@ -36,46 +48,32 @@
|
|
36
48
|
|
37
49
|
}
|
38
50
|
|
39
|
-
|
51
|
+
|
52
|
+
|
53
|
+
|
40
54
|
|
41
55
|
```
|
42
56
|
|
43
|
-
|
57
|
+
```c言語
|
44
58
|
|
45
|
-
Main.c:1
|
59
|
+
Main.c:14:20: warning: missing terminating '"' character [-Winvalid-pp-token]
|
46
60
|
|
47
|
-
printf("%s
|
61
|
+
printf("%s,str);
|
48
62
|
|
49
|
-
^
|
63
|
+
^
|
50
64
|
|
51
|
-
Main.c:1
|
65
|
+
Main.c:14:20: error: expected expression
|
52
66
|
|
53
|
-
Main.c:1
|
67
|
+
Main.c:23:1: error: expected '}'
|
54
68
|
|
55
|
-
|
69
|
+
^
|
56
70
|
|
57
|
-
|
71
|
+
Main.c:3:1: note: to match this '{'
|
58
72
|
|
59
|
-
|
73
|
+
{
|
60
74
|
|
61
|
-
|
75
|
+
^
|
62
76
|
|
63
|
-
^
|
64
|
-
|
65
|
-
Main.c:16:2: error: expected '}'
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
^
|
70
|
-
|
71
|
-
Main.c:2:15: note: to match this '{'
|
72
|
-
|
73
|
-
int main(void){
|
74
|
-
|
75
|
-
^
|
76
|
-
|
77
|
-
1 warning and
|
77
|
+
1 warning and 2 errors generated.
|
78
|
-
|
79
|
-
コード
|
80
78
|
|
81
79
|
```
|