回答編集履歴
4
NULL 文字がコピーされない場合があるようなのでそれに対応した
answer
CHANGED
@@ -10,12 +10,13 @@
|
|
10
10
|
char i_moji[20], o_moji[20];
|
11
11
|
printf("文字列を入力してください(19文字以内):");
|
12
12
|
scanf("%s", i_moji);
|
13
|
+
strcpy(o_moji, i_moji);
|
13
|
-
o_moji[0] = toupper(
|
14
|
+
o_moji[0] = toupper(o_moji[0]);
|
14
15
|
|
15
|
-
for (int i = 1; i < strlen(
|
16
|
+
for (int i = 1; i < strlen(o_moji); i++) {
|
16
|
-
o_moji[i] = tolower(
|
17
|
+
o_moji[i] = tolower(o_moji[i]);
|
17
18
|
}
|
18
|
-
|
19
|
+
|
19
|
-
printf("%s%s", o_moji, i_moji);
|
20
|
+
printf("%s %s", o_moji, i_moji);
|
20
21
|
}
|
21
22
|
```
|
3
ヘッダーを消したのを戻した
answer
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
```c
|
4
4
|
#include <stdio.h>
|
5
|
+
#include <ctype.h>
|
6
|
+
#include <string.h>
|
5
7
|
|
6
8
|
int main(void)
|
7
9
|
{
|
2
余計なヘッダーを消した
answer
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
```c
|
4
4
|
#include <stdio.h>
|
5
|
-
#include <string.h>
|
6
|
-
#include <ctype.h>
|
7
5
|
|
8
6
|
int main(void)
|
9
7
|
{
|
1
表現の修正
answer
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
質問の文章からやりたい事を解読するのが難しいのですが、「先頭のみ大文字、残りを小文字にしたい」と
|
1
|
+
質問の文章からやりたい事を解読するのが難しいのですが、「先頭のみ大文字、残りを小文字にしたい」と解釈しました。
|
2
2
|
|
3
3
|
```c
|
4
4
|
#include <stdio.h>
|