C++统计数字字符个数
#include <iostream>
using namespace std;
int main(){
char a;
int n,m;
cin>>n;
for (int i=0;i<n;i++){
cin>>a;
}
for (int i=0;i<n;i++){
if(a>='0'&&a<='9'){
m++;
}
}
cout<<m<<endl;
return 0;
}
https://blog.51cto.com/u_15467636/4864098
页:
[1]