Problem : 2025 ( 查找最大元素 ) Judge Status : AcceptedRunId : 6000694 Language : C Author : qq1203456195Code 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 }
转载于:https://www.cnblogs.com/CheeseZH/archive/2012/05/26/2518987.html
相关资源:数据结构—成绩单生成器
转载请注明原文地址: https://win8.8miu.com/read-1494683.html