[C Language] three digits in reverse order, digits in reverse order in C Language
Bytes ----------------------------------------------------------------------------------------
// Main. c
// Demo8
// Created by weichen on 14/12/18.
// Copyright (c) 2014 weichen. All rights reserved.
# Include <stdio. h> int main () {int a = 0; printf ("input a three-digit number:"); scanf ("% d", & ); // In scanf, You need to input multiple numbers separated by spaces or commas. Otherwise, scanf reads the initial value int bai = a/100; // hundreds of digits int shi = a % 100/10; // ten digits int ge = a % 100% 10; // single digit printf ("the number after inverted order is: % d ", ge * 100 + shi * 10 + bai );}
Note: This question focuses on the idea of solving such problems, which should be split first and then combined.
@ Blackeye poet <www. chenwei. ws>