Introduction to Programming--c Language 1th Week programming Exercise 1 Reverse three digits (5 points)

Source: Internet
Author: User

1TH Week Programming Exercise

View Help

return

The 1th week of programming exercises can be done at any time until the end of the course.
After you have completed your job in your IDE or editor, copy and paste the entire contents of the source code into the code area of the topic and you can submit it, and then you can view the results of the online compilation and operation.
Do not export anything outside of the program that asks for the output.

In accordance with the terms of academic integrity, I guarantee that this work is done independently.

Warm tips:

1. This assignment belongs to the online Judge topic and is enigmatic grading by the system immediately after submission.

2. Students can submit an unlimited number of answers before the deadline , and the system will take the highest score as the final result.

1 three digits in reverse order (5 points)

Topic content:

Three-digit number in reverse order:

The program reads a positive three-digit number each time, and then outputs the number in reverse order. Note that when the input number contains the end of 0 o'clock, the output should not have a leading 0. For example, enter 700 and the output should be 7.

Hint: With%10 can get single digit, with/100 can get hundred number .... The three numbers that are obtained are combined: Hundreds *100+ 10 bits *10+, and the results are obtained.

Input format:

Each test is a 3-bit positive integer.

Output format:

The number of output reverse order.

Input Sample:

123

Sample output:

321

time limit: 500ms memory limit: 32000kb
  main.c//  hello////  Created by Anzhongyin on 2016/11/27.//  Copyright 2016 anzhongyin. All rights reserved.//#include <stdio.h>int main (int argc, const char * argv[]) {    //Insert code    here ... int i = 0;    int i1 = 0;    int i2 = 0;    int i3 = 0;    int m = 0;           scanf ("%d", &i);    i1=i%10; Digit    i2= (i%100)/10;  10-bit    i3=i/100;    hundred    M=i1*100+i2*10+i3;    printf ("%d\n", m);    return 0;}

  

Introduction to Programming--c Language 1th Week programming Exercise 1 Reverse three digits (5 points)

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.