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.
Note: In addition to the output of the topic requirements, can not output any other content, such as input prompt, the output of the description and so on can not. This topic requires the output of reverse order number, the program can only output this number, in addition to any content can not be output.
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
1#include <stdio.h>2 intMain () {3 intinput=0;4scanf"%d",&input);5 inthundred=input/ -;6 intTen= (input/Ten)%Ten;7 intsingle=input%Ten;8 intnewnum=single* -+ten*Ten+Hundred;9printf"%d", newnum);Ten return 0; One}
C language Programming _ Zhejiang University--the 1th week of programming exercises _ three digits in reverse order