2017.字符串统计

#include<iostream>

using namespace std;

int main(){

         int n,i,s;

         char x;

         cin>>n;

         getchar();

         for(i=0;i<n;i++){

                   s=0;

                   while((x=getchar())!=' ')

                   if(x>='0'&&x<='9')

                   s++;

                   cout<<s<<endl;

         }

         return 0;

}

原文地址:https://www.cnblogs.com/huoyuying/p/9736634.html