Nine degrees OJ 1066 string sort

Source: Internet
Author: User

Topic 1066: Sorting strings

time limit:1 seconds

Memory limit:32 MB

Special question: No

submitted:4919

Resolution:1983

Title Description:

Enter a string of not more than 20 length, the input string, according to the size of the ASCII code from small to large to sort, please output sorted results

Input:

A string whose length is n<=20

Output:

The input sample may have more than one set, for each test sample,

Sorts the input string from small to large according to the size of the ASCII code, outputting the sorted result
Sample input:
Dcba
Sample output:
Abcd
#include <stdio.h> #include <string.h> #include <iostream> #include <algorithm>using namespace Std;char a[21];int Main (int argc, char *argv[]) {while    (~scanf ("%s", a)) {        sort (A,a+strlen (a));        printf ("%s\n", a);    }    return 0;} /**************************************************************    problem:1066    user:kirchhoff    language:c++    result:accepted    time:90 Ms    memory:1520 kb



Nine degrees OJ 1066 string sort

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.