Problem : 2025 ( 查找最大元素 ) Judge Status : Accepted
RunId : 6000694 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
RunId : 6000694 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h> 2 int main() 3 { 4 int i,max; 5 char str[101]; 6 while (scanf("%s",str)!=EOF) 7 { 8 i=0; 9 max=-1; 10 while(str[i]!='\0') 11 { 12 max=max>str[i]?max:str[i]; 13 i++; 14 } 15 i=0; 16 while (str[i]!='\0') 17 { 18 printf("%c",str[i]); 19 if(str[i]==max) printf("(max)"); 20 i++; 21 } 22 printf("\n"); 23 24 } 25 return 0; 26 }