#include<iostream>
#include<string>
using namespace std;
int main(){
string input;
string str;
getline(cin, input);
int flag = 1;
if(input.length() == 1){
cout<<input<<endl;
return 0;
}
int position = 0;
for(int i = 0; i < input.length(); i++){
str.assign(1, input[i]);
// cout<<"str = "<<str<<endl;
position = input.find(str, 0);
if(position == input.length() - 1)
{cout<<str<<endl; return 0;}
else if(input.find(str, position + 1) == input.npos)
{cout<<str<<endl; return 0;}
}
cout<<"."<<endl;
return 0;
}
找出字符串中第一个只出现一次的字符
最新推荐文章于 2022-12-08 11:28:25 发布