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
B52 Club
Answers: 0
Views: 5
Rating: 0
Vebo TV Trực Tiếp Bóng Đá HD - Link xem Bóng Đá Trực Tuyến
Answers: 0
Views: 5
Rating: 0
Vebo TV Trực Tiếp Bóng Đá HD - Link xem Bóng Đá Trực Tuyến
Answers: 0
Views: 4
Rating: 0
69vnjpnet
Answers: 0
Views: 6
Rating: 0
Thành Lập Công ty Offshore
Answers: 0
Views: 4
Rating: 0
nhaxequanghuy
Answers: 0
Views: 4
Rating: 0
X8Club mobi
Answers: 0
Views: 9
Rating: 0
IP88 ⭐ Nhà Cái IP88.COM Uy Tín [T6/2025] | Đăng Ký +88K
> More questions...
Answers: 0
Views: 12
Rating: 0