输入一个三位数,把个位和百位对调后输出


Description

输入一个三位自然数,然后把这个数的百位数与个位数对调,输出对调后的数

Input

输入一行,只有一个整数x(100<=x<=999)。
 

Output

输出只有一行,包括1个整数。

Sample Input 

123

Sample Output

321
 
太水了。。。
AC代码:
 1 import java.util.Scanner;
 2 
 3 public class Main {
 4     public static void main(String[] args) {
 5         Scanner sc = new Scanner(System.in);
 6         String str = sc.next();
 7         int num = Integer.parseInt(str.charAt(2)+""+str.charAt(1)+""+str.charAt(0));
 8         System.out.println(num);
 9     }
10 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM