The page of Hang Dian's water questions have not yet been half done yet. It is obviously not appropriate to come to ACM and start to do the following. I am used to refreshing a water question on this page before the AC every day. When I see this question, I want to judge that the character is the largest in this line by entering it.ProgramAnd found that there is not much faster than others. I don't understand how the 0 s 0 K master did it, even though I am extremely reluctant to brush the list ..
View code
# Include <algorithm> # Include <Iostream> # Include <Cstdlib> # Include <Cstring> # Include <Cstdio> Using Namespace STD; Int Main (){ String STR; Char Ch, Ma; Bool Flg; While ( 1 ) {Str = "" , MA = ' A ' - 1 , Flg = False ; While (CH = Getchar ())){ If (CH = EOF) {flg = True ; Break ;} If (CH = ' \ N ' ) Break ; If (CH> Ma) Ma = Ch; Str + = Ch ;} Int Len = Str. Length (); For ( Int I = 0 ; I <Len; I ++ ) {Printf ( " % C " , STR [I]); If (STR [I] =Ma) printf ( " (Max) " );} If (Flg) Break ; Printf ( " \ N " );} Return 0 ;}
You do not need to mark the source.