码迷,mamicode.com
首页 > 其他好文 > 详细

hdu 2025 查找最大元素

时间:2014-08-14 20:47:39      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:io   for   ar   html   htm   har   return   hdu   

#include<stdio.h>
#include<string.h>
int main()
{
   int i,len;
   char str[110],max;
   while(~scanf("%s",str))
   {
     len=strlen(str);
     max='A';
      for(i=0;i<len;i++)
        if(str[i]>max)
          max=str[i];
      for(i=0;i<len;i++)
      {
        printf("%c",str[i]);
        if(str[i]==max)
          printf("(max)");
      }
      printf("\n");
   }    
   return 0;
}

hdu 2025 查找最大元素,布布扣,bubuko.com

hdu 2025 查找最大元素

标签:io   for   ar   html   htm   har   return   hdu   

原文地址:http://blog.csdn.net/lihaogegehuting/article/details/38561531

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!