#t214. 反向输出一个三位数(增强版)

反向输出一个三位数(增强版)

Reverse a Three-Digit Number (Enhanced)

Problem Description

Reverse a three-digit number, without leading zeros.

Input Format

A three-digit number nn.

Output Format

Output nn reversed.

Sample Input 1

100

Sample Output 1

1

Sample Input 2

101

Sample Output 2

101

Sample Input 3

123

Sample Output 3

321

Hint

  • This differs from the previous problem in just one point: this time do not keep the leading zeros (100 → 1). Of the two approaches from the previous problem, which one no longer works here?
  • Digit-by-digit approach: assemble the reversed number as ones*100 + tens*10 + hundreds and print it as an integer.
  • Verify with the samples: 100 → 1; 101 → 101.