#include <iostream> using namespace std; int main() { string str; string ans; int min = 20; cin >> str; int len = str.length(); int a[26] = {0}; for(int i = 0; i < len; i++){ a[str[i] - 'a']++; // 此时每个字符出现的次数已经记在数组中了 } for(int i = 0; i < 26; i++){ if( (a[i] > 0) && (a[i] < min) ){ min = a[i]; // 这是就找到了字符串中出现次数最少的字符的次数 } } // 得到不包含字符串中出现次数最少的字符的字符串 for(int i = 0; i < len; i++){ if(a[str[i] - 'a'] == min){ continue; } ans += str[i]; } cout << ans << endl; return 0; } // 64 位输出请用 printf("%lld")