質問編集履歴
2
編集
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
### 該当のソースコード
|
|
15
15
|
|
|
16
|
-
c
|
|
16
|
+
```c
|
|
17
|
-
|
|
18
17
|
#include <stdio.h>
|
|
19
18
|
#include <string.h>
|
|
20
19
|
|
|
@@ -26,6 +25,7 @@
|
|
|
26
25
|
else printf("Yes\n");
|
|
27
26
|
return 0;
|
|
28
27
|
}
|
|
28
|
+
```
|
|
29
29
|
|
|
30
30
|
### 試したこと
|
|
31
31
|
|
1
行をそろえました
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -19,15 +19,14 @@
|
|
|
19
19
|
#include <string.h>
|
|
20
20
|
|
|
21
21
|
int main() {
|
|
22
|
-
char a[1000], b[1000],c;
|
|
22
|
+
char a[1000], b[1000], c;
|
|
23
|
-
scanf("%s%c%s", a, &c, b);
|
|
23
|
+
scanf("%s%c%s", a, &c, b);
|
|
24
|
-
strcat(a, a);
|
|
24
|
+
strcat(a, a);
|
|
25
|
-
if (strstr(a, b) == NULL) printf("No\n");
|
|
25
|
+
if (strstr(a, b) == NULL) printf("No\n");
|
|
26
|
-
else printf("Yes\n");
|
|
26
|
+
else printf("Yes\n");
|
|
27
|
-
return 0;
|
|
27
|
+
return 0;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
### 試したこと
|
|
32
31
|
|
|
33
32
|
最初は配列の要素数を101にしていて、strcatで二倍になるのが原因かなと思って要素数を1000にふやしたのですがだめなのでstrcatやstrstrで問題が起きているのかなとも思うのですがわかりません。
|