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
Sunwin
Answers: 0
Views: 1
Rating: 0
Nhà Cái XIN88
Answers: 0
Views: 2
Rating: 0
HELLO88
Answers: 0
Views: 4
Rating: 0
bon68
Answers: 0
Views: 11
Rating: 0
bon68
Answers: 0
Views: 6
Rating: 0
bon68
Answers: 0
Views: 6
Rating: 0
bon68
Answers: 0
Views: 6
Rating: 0
Bon68 – Nền Tảng Cá Cược Thể Thao Hàng Đầu Châu Á 2025
> More questions...
Answers: 0
Views: 6
Rating: 0