标签:The using out 次数 实例 数值 hdu main 字符数组
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 100429 Accepted Submission(s): 55317
1 #include<cstdio> 2 using namespace std; 3 int main() 4 { 5 char a[1000],*t; 6 int n; 7 while(scanf("%d",&n)!=EOF) 8 { 9 while(n--) 10 { 11 int count = 0; 12 scanf("%s",a); 13 t = a; 14 while(*t)//遇到‘\0‘时停止 15 { 16 if(*t>=‘0‘ && *t <=‘9‘) 17 { 18 count++; 19 } 20 t++;//指向字符数组a的指针向后移动一位 21 } 22 printf("%d\n",count); 23 } 24 } 25 return 0; 26 }
标签:The using out 次数 实例 数值 hdu main 字符数组
原文地址:https://www.cnblogs.com/knmxx/p/9380386.html