算法1
参考文献
C++ 代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
string st;
bool s=0;
while(getline(cin,st)){
for(int i=0;i<st.size();i++){
if(st.find(st[i])==st.rfind(st[i])){
cout<<st[i]<<endl;
s=1;
break;
}
}
}
if(s==0)cout<<"no"<<endl;
}