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