题目:在一个字符串中找到第一个只出现一次的字符。如输入abaccdeff,则输出b
//第一个只出现一次的字符 #include <iostream> using namespace std; int main() { int p[256]; memset(p,0,sizeof(p)/sizeof(int)); char *m_string="abaccdef"; char *key=m_string; while (*key!='\0') { p[*(key++)]++; } key=m_string; while (*key!='\0') { if (p[*key]==1) { cout<<*key; } key++; } return 0; }