【topic】
[Thinking] Use a character array to read a string, set a max to record the largest letter, and initialize it to '\0'. Then iterate over the string, inserting (max) after the output maximum letter.
[Code] The C++ code of AC is as follows:
#include <iostream> #include <string.h> using namespace std; char s[1000]; intmain() { while (cin >> s) { char max = '\0'; int len = strlen(s); for (int i = 0;i < len;i++) { if (s[i] > max) max = s[i]; } for (int i = 0;i < len;i++) { cout << s[i]; if (s[i] == max) cout << "(max)"; } cout << endl; } return 0; }