杭电OJ 2025(C++)
作者:互联网
查找最大元素
#include<iostream>
using namespace std;
#include<string>
int main()
{
int i;
string a;
while(cin>>a)
{
char max = a[0];
for(i = 1 ; i < a.size() ; i++)
if(max < a[i])
max = a[i];
for(i = 0 ; i < a.size() ; i++)
{
cout<<a[i];
if(a[i] == max)
cout<< "(max)";
}
cout<<endl;
}
return 0;
}
标签:std,OJ,int,max,++,杭电,2025,include,size 来源: https://blog.csdn.net/evernight_17/article/details/118761938