题解 | #[NOIP2018]标题统计#
[NOIP2018]标题统计
https://www.nowcoder.com/practice/b14b87bc6a4547a6839e0a5867c98dba
#include<stdio.h>
#include<string.h>
int main(){
char c[100];
int sum=0,i;
gets(c);
for(i=0;i<strlen(c);i++){
if((c[i]>='0'&&c[i]<='9')||(c[i]>='a'&&c[i]<='z')||(c[i]>='A'&&c[i]<='Z')){
sum+=1;
}
}
printf("%d",sum);
}
#include<string.h>
int main(){
char c[100];
int sum=0,i;
gets(c);
for(i=0;i<strlen(c);i++){
if((c[i]>='0'&&c[i]<='9')||(c[i]>='a'&&c[i]<='z')||(c[i]>='A'&&c[i]<='Z')){
sum+=1;
}
}
printf("%d",sum);
}