HDU 2025 Max element search

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.