#include <stdio.h> int main(void) { char str[256]; char s[] = "This is a pen. That is an apple."; int i,j,k,checker; printf("This is a pen. That is an apple.\n\n"); gets(str); for(j=0;j<256;j++) {for(i=j,k=0;str[k]!='\0';k++,i++) {if(str[k]==s[i]) {checker=1; break;} else {checker=0;}}} if(checker==1) {printf("OK!その文字列は含まれています。。\n");} else { printf("NG!その文字列は含まれていません。\n");}}