40分求调
查看原帖
40分求调
1404557
maodan11hao楼主2024/8/22 12:49
#include<bits/stdc++.h>
using namespace std;
struct s{
	char name;
	int cx;
};
s x[1101];
int p;
bool b=true;
string s;
int main(){
	cin>>s;
	for(int i=0;i<s.size();i++){
		for(int j=0;j<p;j++){
			if(x[j].name==s[i]){
				b=false;
				x[j].cx++;
			}
		}
		if(b){
			x[p].name=s[i];
			x[p].cx++;
			p++;
		}
	}
	for(int i=0;i<p;i++){
		if(x[i].cx==1){
			cout<<x[i].name;
			return 0;
		}
	}
	cout<<"no";
	return 0;
}
2024/8/22 12:49
加载中...