回答編集履歴
1
追記
test
CHANGED
@@ -49,3 +49,51 @@
|
|
49
49
|
|
50
50
|
|
51
51
|
```
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
---
|
56
|
+
|
57
|
+
こういうのもありかもしれませんね。
|
58
|
+
|
59
|
+
```C
|
60
|
+
|
61
|
+
#include <stdio.h>
|
62
|
+
|
63
|
+
#include <string.h>
|
64
|
+
|
65
|
+
#include <stdlib.h>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
int main(void) {
|
70
|
+
|
71
|
+
char inputNum[1000];
|
72
|
+
|
73
|
+
int stock[3];
|
74
|
+
|
75
|
+
char token[] = " ";
|
76
|
+
|
77
|
+
char *tok;
|
78
|
+
|
79
|
+
int count = 0;
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
fgets(inputNum, sizeof(inputNum), stdin);
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
for(tok = strtok(inputNum, token); tok != NULL; tok = strtok(NULL, token), count++) {
|
88
|
+
|
89
|
+
printf("%d\n", stock[count] = atoi(tok));
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
return 0;
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
```
|