Any problem with this code
#include<stdio.h>
/*Counts digits, white numbers, others*/
main()
{
int c, i, nwhite, nother;
int ndigit[10];
nwhite=nother=0;
for(i=0; i<10; ++i)
ndigit[i]=0;
while((c=getchar())!=EOF)
if(c>='0' && c<='9')
++ndigit[c-'0'];
else if(c==' ' || c=='\n' || c=='\t')
++nwhite;
else
++nother;
printf("digits= ");
for(i=0; i<10; ++i)
printf("%d ", ndigit[i]);
printf("\nwhitespace=%d, other=%d\n", nwhite, nother);
}
2 Answers
Top contributors in Uncategorized category
Unanswered Questions
How to Check Your Tyres for Wear and Tear
Answers: 0
Views: 7
Rating: 0
RR88
Answers: 0
Views: 9
Rating: 0
vibetsocial
Answers: 0
Views: 9
Rating: 0
red8888me
Answers: 0
Views: 9
Rating: 0
Red88 - Sàn Cá Cược Thể Thao Hấp Dẫn Nhất Hành Tinh
Answers: 0
Views: 8
Rating: 0
DA88
Answers: 0
Views: 8
Rating: 0
Điểm Karma là gì?
Answers: 0
Views: 9
Rating: 0
VU88 - Nhà Cái Đỉnh Cao Châu Á
> More questions...
Answers: 0
Views: 9
Rating: 0