20170727 JAVA练习题:输入一个三位数字,将其倒序组合输出

JAVA练习题:输入一个三位数字,将其倒序组合输出
package com.chy.g2;

import java.util.Scanner;

public class Exercise1 {

public static void main(String[] args) {
// TODO Auto-generated method stub
int b, c, d = 0;
System.out.println(“请输入数字:”);

Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
b = num / 100;
num %= 100;
c = num / 10;
num %= 10;
d = num / 1;
int result=d*100+c*10+b;
System.out.println(“结果是”+result);
}

}

    原文作者:xcwc1995
    原文地址: https://blog.csdn.net/xcwc1995/article/details/76216563
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞