スレ立てるまでもない質問はここで 98匹目
■ このスレッドは過去ログ倉庫に格納されています
0009デフォルトの名無しさん
2009/06/23(火) 17:02:22main()
{
int ch,i,nwhite=0,nother=0;
int ndigit[10]={0};
printf("文字を入力してください\n");
while ( (ch=getchar()) !=EOF)
if (ch>='0' && ch<='9')
++ndigit[ch-'0'];
else if (ch==' ' || ch=='\n' || ch=='\t')
++nwhite;
else
++nother;
printf("数字の入力回数\n");
for(i=0;i<10;i++)
printf("%6d : %3d \n", i, ndigit[i]);
printf("空白 :%d \n", nwhite);
printf("その他 :%3d \n",nother);
}
これに加える感じでなんとか
■ このスレッドは過去ログ倉庫に格納されています