Simple application of strtok function Hdu 1106

Source: Internet
Author: User
Tags strtok

SortTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others) Total Submission (s): 38231 Accepted Submission (s): 10832

Problem description Enter a line of numbers, if we take this line of the number of ' 5 ' as a space, then we get a line with a space separated by a number of non-negative integers (some integers may start with ' 0 ', these headers ' 0 ' should be ignored, unless the integer is a number of ' 0 ', then this integer is 0).

Your task is to sort the output from small to large for these segmented integers.


Input inputs contain multiple sets of test cases, each set of input data with only one row of numbers (no spaces between the numbers), and the length of the line number is not greater than 1000.

Input data Assurance: The resulting non-negative integers are not greater than 100000000, and the input data cannot be composed of ' 5 '.

Output for each test case, the result of an integer ordering of the outputs is divided by a single space between the adjacent two integers, one row for each set of outputs.

Sample Input
0051231232050775

Sample Output
0 77 12312320

Sourcepoj
I heard that with SSCANF can also, unfortunately, the function is not too familiar.


Simple application of strtok function Hdu 1106

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.