UVA 494(Kindergarten Counting Game)
生活随笔
收集整理的這篇文章主要介紹了
UVA 494(Kindergarten Counting Game)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這道題的標題中的幼兒園讓人看得郁悶,計算單詞的數目...
#include<stdio.h>#include<stdlib.h>
#include<ctype.h>
#include<string.h>
char ch[1000];
int main()
{
char a[100];
while( gets(ch) != NULL)
{
int len = strlen(ch);
int cnt = 0;
for(int i = 0; i <= len; i ++)
{
if( isalpha( ch[i] ) && !isalpha( ch[i+1] ) )
cnt ++;
}
printf("%d\n", cnt);
}
return 0;
}
?
轉載于:https://www.cnblogs.com/Yu2012/archive/2011/11/03/2233824.html
總結
以上是生活随笔為你收集整理的UVA 494(Kindergarten Counting Game)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 完全卸载sql2005(试了以后很成功,
- 下一篇: 超声射频信号的产生(RF Signal)