hdu 2025 查找最大元素 (水)

 不明白为什么要放在dp里

 

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    char add[10]="(max)";
    char str[200];
    while(scanf("%s",str)!=EOF)
    {
        int len=strlen(str);
        char ma='a';
        int i;
        for(i=0;i<len;i++)
        {
          if(str[i]>ma) ma=str[i];
        }
        for(i=0;i<len;i++)
        {
          printf("%c",str[i]);
          if(str[i]==ma) printf("%s",add);
        }
        printf("\n");
    }
    return 0;
}

 

posted @ 2015-01-25 23:06  sola94  阅读(98)  评论(0编辑  收藏  举报