1107:0 start-up algorithm 14--three-digit reversal

Source: Internet
Author: User

1107:0 start-up algorithm 14--three-digit reversal time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:4915 accepted:2378
[Submit] [Status] [Web Board] Description

Water problem

Input

Enter a 3-digit number (the title contains multiple sets of test data)

Output

Separates the 3-digit hundred, 10-bit, and single-digit, inverted output (one row of test data per group)

Sample Input
250

Sample Output
052

HINT

Separating out the numbers, you can use the remainder and the divisor.

Note that in C, 2 integers are multiplied except for the result or integer, such as 8/3 in the C language, and the result is 2.

Use symbol% for remainder

For example, the result of 8%3 should be 2 or 8 divided by 3 after the remainder.


Source

0 Starting point Learning algorithm

1#include <stdio.h>2 intMain () {3     intx,a,b,c;4      while(SCANF ("%d", &x)! =EOF) {5a=x/ -;6b=x% -/Ten;7c=x%Ten;8printf"%d%d%d\n", c,b,a);9     }Ten     return 0; One}

Think about it, if it's not a three-digit number, is it a multi-digit number? What if the previous 0 is going to be shed?

1107:0 start-up algorithm 14--three-digit reversal

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.