社区讨论

为什么编译失败?

P5015[NOIP 2018 普及组] 标题统计参与者 4已保存回复 6

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
6 条
当前快照
1 份
快照标识符
@m24sjppe
此快照首次捕获于
2024/10/11 21:56
去年
此快照最后确认于
2025/11/04 17:25
4 个月前
查看原帖
CPP
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int ans=0;
int main()
{
//	freopen("t.in","r",stdin);
//	freopen("t.out","w",stdout);
	char s[10];
	gets(s);
	int n=strlen(s);
	for(int i=0;i<n;i++)
	{
		if(s[i]>='a' && s[i]<='z') ans++;
		if(s[i]>='A'&&s[i]<='Z') ans++;
		if(s[i]>='0'&&s[i]<='9') ans++;
	}
	cout<<ans;
	return 0;	
}

回复

6 条回复,欢迎继续交流。

正在加载回复...