おまいら!今日からC言語を学んでいくぞー!パート2
■ このスレッドは過去ログ倉庫に格納されています
0144デフォルトの名無しさん
2005/10/10(月) 18:49:37#include <stdio.h>
#include <ctype.h>
int main()
{
char *text="this is a pentium4";
int count;
int mojisuu;
count=0;
mojisuu=0;
while (*(text++) != NULL)
{
if (isalpha(*text) && mojisuu==0)
{
mojisuu++;
count++;
}
if (*text == ' ')
{
mojisuu=0;
}
}
printf("%d\n", count);
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています