#include <bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { for (auto &it : str) { it = tolower(it); } cout << str << endl; string res; string tmp; int i = 0; int cnt = 0; while(i<str.size()){ if (isdigit(str[i])) { cnt = stoi(str.substr(i)); while (i<str.size()&&isdigit(str[i])) ++i; while (cnt--) { res += tmp; } tmp = ""; } else if (str[i] == '-') { char pre = str[i - 1]; char nxt = str[i + 1]; char ptr = pre; tmp.pop_back(); while (ptr != nxt) { tmp += ptr; if (ptr == 'z') ptr = 'a'; else ++ptr; } tmp += nxt; i += 2; } else { tmp += str[i++]; } } cout << res << endl; vector<int> dp(26, 0); int max_count = 0; for (auto it : res) { ++dp[it - 'a']; max_count = max(max_count, dp[it - 'a']); } for(int i=0;i<dp.size();++i) if (dp[i] == max_count) { char ch = i + 'a'; cout << ch << dp[i] << endl; break; } } return 0; }
点赞 评论

相关推荐

想去毕业旅行的斑马在...:学校不是92的话,没有实习经历投不了大厂,去投中小厂,拿点实习经历
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务