题解
2025-03-22 20:48:03
发布于:江苏
0阅读
0回复
0点赞
#include<iostream>
using namespace std;
string s;
int a,b,c;
int main(){
getline(cin,s);
for(int i=0;s[i]!='?';i++){
if(s[i]>='a' && s[i]<='z'){
a++;
}
else if(s[i]>='0' && s[i]<='9'){
b++;
}
else{
c++;
}
}
cout<<"Letters="<<a<<endl
<<"Digits="<<b<<endl
<<"Others="<<c<<endl;
}
这里空空如也
有帮助,赞一个