Submission

Status:
Compilation Error

Score: 0

User: foldnut

Problemset: ภูเขา

Language: cpp

Time: 0.000 second

Submitted On: 2024-10-11 14:31:08

#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);
}