赞
踩
- package com.org.hello;
- import java.util.*;
- import java.io.*;
- public class TestHello {
- public static void main(String[] args)
- {
- Scanner cin=new Scanner(System.in);
- System.out.println("请输入一个四位整数:");
- int i=cin.nextInt();
- int a=i/1000;
- int b=(i-a*1000)/100;
- int c=(i-a*1000-b*100)/10;
- int e=i-a*1000-b*100-c*10;
- System.out.println(i+"个位数是:"+e);
- System.out.println(i+"十位数是:"+c);
- System.out.println(i+"百位数是:"+b);
- System.out.println(i+"千位数是:"+a);
- System.out.println(i+"逆序数是:"+e+c+b+a);
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。