到底怎么写才能过
查看原帖
到底怎么写才能过
370425
SCP_基金会楼主2020/8/18 14:11

这代码改过N次了,甚至看过题解之后还是不过,为啥

#include <iostream>
#include <cstring>
using namespace std;
int main(){
	char s[10];
	cin>>s;
	int n=strlen(s);
	int b=0;
	for(int i=0;i<n;i++){
		if(s[i]>='A'&&s[i]<='Z'){
		b++;
        }
		if(s[i]>='a'&&s[i]<='z'){
		b++;
        }
		if(s[i]>='0'&&s[i]<='9'){
		b++;
        }
	}
	cout<<b;
	return 0;
}
2020/8/18 14:11
加载中...