hdu2000 ASCII code Sort "C + +"

Source: Internet
Author: User

ASCII-code Ordering

Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 206054 Accepted Submission (s): 82273


Problem description Input Three characters, the ASCII code of each character is printed in order from small to large to output these three characters.

Input data has more than one group, each of which consists of three characters and no spaces between them.

Output for each set of input data, one line is printed, and the characters are separated by a space.

Sample INPUTQWEASDZXC

Sample outpute q wa d SC x z
1#include <iostream>2#include <cstring>3#include <algorithm>4 using namespacestd;5 intMain ()6 {7     stringS"");8     Chara[Ten];9      while(Getline (cin,s))Ten     { One strcpy (A,s.c_str ()); ASort (a,a+3); -          for(inti =0; I <3;++i) -         { the             if(I <2) -             { -cout << A[i] <<" ";//don't know why not cout << A[i] + ""; -             } +             Else -             { +cout << A[i] <<Endl; A             } at  -         } -     } -     return 0; -}

hdu2000 ASCII code Sort "C + +"

Related Article

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.