2009-04-04 12:30:59來源不明

幼稚園的算數遊戲

/************************************************************/

#include<stdio.h>     
#include<stdlib.h>
#include<string.h>
main()
{
  int temp=0,a,b,time=0;
  char c[999999];
  while(gets(c))   
  {temp=0;time=0; /*兩者皆要歸0*/
   for(a=0;a<strlen(c);a++)
    {
      if((c[a]>=65&&c[a]<=90)||(c[a]>=97&&c[a]<=122))
       temp=1;
      else
      {
       time=temp+time;
        temp=0;               /*else也要刮弧 不然沒有歸0到*/
      }
    }
   if(temp!=0) /*直接英文結尾 temp則為1 但是沒加到*/
    {
     time++;
    }
     printf("%d\n",time);
  }
 return 0;    
}

上一篇:因數分解

下一篇:Hashmat的戰役