1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| #include<stdio.h>
#include<string.h>
int main() {
char s[120],a[1000];
char max;
int i,j;
while(scanf("%s",s)!=EOF) {
for(max=i=0; i<strlen(s); i++) {
if(s[i]>max)
max=s[i];
}
memset(a,0,sizeof(a));
for(i=0,j=0; i<strlen(s); i++) {
a[j]=s[i];
if(s[i]==max) {
j++;
a[j]='(';
j++;
a[j]='m';
j++;
a[j]='a';
j++;
a[j]='x';
j++;
a[j]=')';
}
j++;
}
printf("%s\n",a);
}
return 0;
}
|