纬度打击
2021-01-21 20:04hdu的acm题T2025,为什么输入“xxx”和“aaa”和“mmm”会无输出。
#include <iostream> #include <string> using namespace std; int main(){ string str; char tem; while (getline(cin,str)) { str.push_back('0'); tem=str[0]; for (int i = 1; i < str.length()-1; i++) { if (tem < str[i]) { tem=str[i]; } } for (int i = 0; i < str.length()-1; i++) { if (tem==str[i]) { str.insert(i+1,"(max)"); } } for (int i = 0; i < str.length() - 1; i++) { cout<<str[i]; } cout<<endl; } return 0; }
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- hdu1312 深搜水题,大佬帮忙看看为什么A不了?
- c语言
- c++
- 测试用例
- 1个回答
- 关于一个算法问题的探讨,怎么才能计算得到rank
- lines
- string
- acm
- Golang
- 2个回答
- Buy the souvenirs
- instance
- as
- each
- numbers
- 2个回答
- 求强连通分量入门题hdu1269迷宫城堡wa掉了大神帮忙看看
- hdu
- java
- 算法
- 连通分量
- acm
- 1个回答
- Who will be the HDU-START tonight?
- as
- each
- 2个回答
换一换