摘要: 在一个字符串中找到第一个只出现一次的字符。如输入adaccbeff,则输出d。 1 #include<iostream> 2 #include<string> 3 using namespace std; 4 5 char find(const string & s1) 6 { 7 int hash[26] = {0}; 8 for(int i = 0; i < s1.size(); i++) 9 hash[s1[i]-'a']++;10 11 int i;12 for(i = 0; i < s1.size(); i++) /... 阅读全文
posted @ 2012-10-08 10:07 dandingyy 阅读(316) 评论(0) 推荐(0)