回答編集履歴

3

微修正

2015/06/07 12:24

投稿

frogman
frogman

スコア129

test CHANGED
@@ -50,7 +50,7 @@
50
50
 
51
51
  //scanf("%s", str);
52
52
 
53
- fgets(str, 256, stdin);
53
+ fgets(str, sizeof(str), stdin);
54
54
 
55
55
  str[strlen(str) - 1] = '\0';
56
56
 

2

微修正

2015/06/07 12:24

投稿

frogman
frogman

スコア129

test CHANGED
@@ -1,8 +1,6 @@
1
1
  標準関数を使用しないのであれば、なかば、強引に。。。
2
2
 
3
3
  ```lang-<c>
4
-
5
-
6
4
 
7
5
  #include<stdio.h>
8
6
 
@@ -52,7 +50,9 @@
52
50
 
53
51
  //scanf("%s", str);
54
52
 
53
+ fgets(str, 256, stdin);
54
+
55
- strcpy( str, "i am foolish" );
55
+ str[strlen(str) - 1] = '\0';
56
56
 
57
57
 
58
58
 

1

微修正

2015/06/07 12:16

投稿

frogman
frogman

スコア129

test CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  ```lang-<c>
4
4
 
5
- コード
6
5
 
7
- ```
8
6
 
9
7
  #include<stdio.h>
10
8
 
@@ -65,3 +63,5 @@
65
63
  Big_letter(str);
66
64
 
67
65
  }
66
+
67
+ ```