Login
Immutable PageDiscussionInfoAttachments
rei05/C言語/10022

MMA

   1 #include<stdio.h>
   2 #include<ctype.h>
   3 #include<string.h>
   4 int main(){
   5 
   6 int counter=0,i;
   7 char word[1000],sen[1000];
   8 
   9 scanf("%s",word);
  10 while(1){
  11   scanf("%s",sen);
  12     if(strcmp(sen,"END_OF_TEXT")==0) break;
  13   for(i=0;sen[i]!='\0';i++){
  14     sen[i]=tolower(sen[i]);
  15   }
  16   if(strcmp(sen,word)==0) counter++;
  17 }
  18 
  19 printf("%d\n",counter);
  20 
  21 return(0);
  22 }

rei05/C言語/10022 (last edited 2012-05-12 01:33:37 by rei05)