String statistics
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 40487 accepted submission (s): 22532
Problem description calculates the number of occurrences of numeric characters in a given string.
The input data has multiple rows. The first row is an integer N, indicating the number of test instances, followed by N rows. Each row contains a string consisting of letters and numbers.
Output: For each test instance, the number of values in the string is output, and each output occupies one row.
Sample Input
2asdfasdf123123asdfasdfasdf111111111asdfasdfasdf
Sample output
69
# Include <stdio. h> char a [1000]; int main () {int N; scanf ("% d", & N); getchar (); // note that while (n --) {int I, T = 0; gets (a); for (I = 0; A [I]! = '\ 0'; I ++) {if (a [I]> = '0' & A [I] <'9') T ++ ;} printf ("% d \ n", T);} return 0 ;}