字符流中第一个不重复的字符,很简单
字符流中第一个不重复的字符
http://www.nowcoder.com/questionTerminal/00de97733b8e4f97a3fb5c680ee10720
string a;
public:
//Insert one char from stringstream
void Insert(char ch)
{
a.push_back(ch);
}
//return the first appearence once char in current stringstream
char FirstAppearingOnce()
{
for(int i=0;i<a.length();i++){ if(a.find_first_of(a[i])==a.find_last_of(a[i])) return a[i]; } return '#'; }
};