只有70分,显示wrong answer too short,求助大佬
查看原帖
只有70分,显示wrong answer too short,求助大佬
53027
keywords楼主2021/8/18 07:47
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[10001];
int main()
{
	int s,f=0,c;
	gets(a);c=strlen(a);
	
	for(int i=0;i<c;i++)
	{
		s=a[i];
		for(int j=i+1;j<c;j++)
		{
			if(s==a[j])
			{
				a[j]='0';a[i]='0';
			}
		}
	}
	for(int i=0;i<c;i++)
	{
		if(a[i]!='0')
		{
			cout<<a[i];
			f=1;
			break;
		}
	}
	if(f==0)
		cout<<"no";
	
	return 0;
}

2021/8/18 07:47
加载中...