hhhhhh,蒙对了!!!!!!!!!!
2024-03-24 18:32:00
发布于:广东
15阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main()
{
int Letters=0,Digits=0,Others=0;
char ch[10001];
fgets(ch,10001,stdin);
int len=strlen(ch);
for(int i=0;i<=len-1;i++)
{
if(ch[i]>='a' and ch[i]<='z')
{
Letters++;
}
if(ch[i]>='0' and ch[i]<='9')
{
Digits++;
}
}
Others=len-Letters-Digits-2;
cout<<"Letters"<<"="<<Letters<<endl<<"Digits"<<"="<<Digits<<endl<<"Others"<<"="<<Others;
}
这里空空如也
有帮助,赞一个