回答編集履歴
3
コード修正
answer
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
int result = 12;
|
8
8
|
char string[13];
|
9
9
|
int count = sprintf(string, "%d\n", result);
|
10
|
-
if (
|
10
|
+
if (0 < count) {
|
11
11
|
write(1, string, count);
|
12
12
|
}
|
13
13
|
}
|
2
コード追記
answer
CHANGED
@@ -4,10 +4,6 @@
|
|
4
4
|
#include <unistd.h>
|
5
5
|
|
6
6
|
int main(void) {
|
7
|
-
#include <stdio.h>
|
8
|
-
#include <unistd.h>
|
9
|
-
|
10
|
-
int main(void) {
|
11
7
|
int result = 12;
|
12
8
|
char string[13];
|
13
9
|
int count = sprintf(string, "%d\n", result);
|
1
コード修正
answer
CHANGED
@@ -4,9 +4,15 @@
|
|
4
4
|
#include <unistd.h>
|
5
5
|
|
6
6
|
int main(void) {
|
7
|
+
#include <stdio.h>
|
8
|
+
#include <unistd.h>
|
9
|
+
|
10
|
+
int main(void) {
|
7
11
|
int result = 12;
|
8
|
-
char string[
|
12
|
+
char string[13];
|
9
|
-
sprintf(string, "%d\n", result);
|
13
|
+
int count = sprintf(string, "%d\n", result);
|
14
|
+
if (EOF != count) {
|
10
|
-
|
15
|
+
write(1, string, count);
|
16
|
+
}
|
11
17
|
}
|
12
18
|
```
|