Online Judge【杭电】[2017]字符串统计问题描述字符串统计[hdu-2017] [3121320297081359] @vjudge问题分析一天竟然只能发20篇博客……这让我怎么填上这个坑嘛……话说昨天保存的博客还丢了……心塞……昨天说的什么来着……好像是……这个题目看到过n遍了! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include<stdio.h> int main() { int i,j,n; char ch; scanf("%d\n",&j); for(i=0; i<j; i++) { n=0; while((ch=getchar())!='\n') { if(ch>='0'&&ch<='9') n++; } printf("%d\n",n); } return 0; }