水一下,其实可以更多利用字符串比较的相关内容的...题目考的太浅没办法
参考代码:
#include<bits/stdc++.h> using namespace std; int main(){ string a; while(cin>>a){ char ss=0; for(int i=0;i<a.length();i++){ if(ss<a[i]){ ss=a[i]; } } //cout<<ss<<"----"<<endl; for(int i=0;i<a.length();i++){ if(ss==a[i]){ cout<<a[i]<<"(max)"; }else{ cout<<a[i]; } } cout<<endl; } return 0; }
0.0分
0 人评分