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
taya365casinoonline
Answers: 0
Views: 10
Rating: 0
79king - Nhà cái đẳng cấp hàng đầu Việt Nam
Answers: 0
Views: 11
Rating: 0
79king - Nhà cái đẳng cấp hàng đầu Việt Nam
Answers: 0
Views: 9
Rating: 0
BK8ipBrasil
Answers: 0
Views: 13
Rating: 0
Bộ sưu tập 100+ Ảnh Độc đáo nhất trong năm 2024
Answers: 0
Views: 15
Rating: 0
"8xbet là một nền tảng cá cược thể thao và sòng bạc trực tuyến được cấp phép, thành lập vào năm 2018,. Website : https://8xbet222.bet/
Answers: 0
Views: 14
Rating: 0
TDTC
Answers: 0
Views: 11
Rating: 0
revo128 SitusJudi
> More questions...
Answers: 0
Views: 14
Rating: 0