题解
2023-08-07 17:17:12
发布于:浙江
22阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
string string;
int Letters = 0 ,Digits = 0 ,Others = 0;
getline(cin ,string);
for (int i = 0 ; i <= string.size() - 2 ; i++){
if ((string[i] >= 'a' && string[i] <= 'z') || (string[i] >= 'A' && string[i] <= 'Z'))
Letters++;
else if (string[i] >= '0' && string[i] <= '9')
Digits++;
else
Others++;
}
printf("Letters=%d\nDigits=%d\nOthers=%d\n" ,Letters ,Digits ,Others); //奇妙の输出
return 0;
}
这里空空如也
有帮助,赞一个