C/C++の宿題を片付けます 74代目
■ このスレッドは過去ログ倉庫に格納されています
0556デフォルトの名無しさん
2006/10/09(月) 19:01:18# include <stdio.h>
# include <string.h>
# include <ctype.h>
int vowel(char c)
{
switch(tolower(c))
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
return 1;
default:
return 0;
}
}
int main(void)
{
char input[0x100];
int i, n;
fgets(input, 0x100, stdin);
n = 0;
for(i = 0; input[i]; i++)
if(vowel(input[i]))
n++;
printf("%d\n", n);
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています