We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71553ca commit 0c1a856Copy full SHA for 0c1a856
String/Substring/Check_Substring.c
@@ -0,0 +1,39 @@
1
+#include<stdio.h>
2
+#define int long long int
3
+#undef int
4
+
5
+int main()
6
+{
7
+ #define int long long int
8
9
+ int n, m;
10
+ scanf("%d %d", &n, &m);
11
+ char s[n], s1[m];
12
+ scanf("%s%s", s, s1);
13
+ int flag;
14
+ for(int i=0; i<=n-m; i++)
15
+ { flag=1;
16
+ for(int j=0; j<m; j++)
17
+ {
18
+ if(s[i+j]!=s1[j])
19
20
+ flag=0;
21
+ break;
22
+ }
23
24
25
+ if(flag==1)
26
27
+ printf("yes");
28
29
30
31
32
+ if(flag==0)
33
34
+ printf("no");
35
36
37
+ return 0;
38
39
+}
0 commit comments