Submission
Status:
[-SS][-SSSSS][xS]
Score: 0
User: foldnut
Problemset: ช่างไฟ
Language: c
Time: 0.002 second
Submitted On: 2024-10-11 14:30:39
#include <stdio.h>
#include <string.h>
int main(){
char str[500];
char substr[100];
gets(str);
gets(substr);
int len1 = strlen(str);
int len2 = strlen(substr);
int cnt = 0;
for(int i = 0;i<len1;i++){
int t = 1;
for(int z = 0;z<len2;z++){
if(str[i + z] != substr[z]){
t = 0;
}
}
if(t == 1) cnt++;
}
printf("%d", cnt);
}