Login
Immutable PageDiscussionInfoAttachments
Diff for "rei05/C言語/10022"

MMA
Differences between revisions 1 and 2
Revision 1 as of 2012-05-11 18:21:23
Size: 375
Editor: rei05
Comment:
Revision 2 as of 2012-05-12 01:33:37
Size: 394
Editor: rei05
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
{{{ {{{#!highlight haskell

   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)