Problem : 2017 ( 字符串统计 )     Judge Status : Accepted
RunId : 6000218    Language : C    Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
 1 #include <stdio.h>
 2 int main()
 3 {
 4     int cnt,i,n;
 5     char str[1000];
 6     scanf("%d",&n);
 7     while (n--)
 8     {
 9         cnt=0;
10         scanf("%s",str);
11         i=0;
12         while (str[i]!='\0')
13         {
14             if(str[i]<='9'&&str[i]>='0')
15                 cnt++;
16             i++;
17         }
18         printf("%d\n",cnt);
19     }
20     return 0;
21 }

 

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2021-09-16
  • 2022-03-04
  • 2022-01-06
  • 2022-01-02
  • 2022-12-23
  • 2021-05-23
猜你喜欢
  • 2021-11-16
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
相关资源
相似解决方案