import java.util.Scanner;
public class Test {
public static void main(String[] args){
System.out.println(“请输入一个三位数”);
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int ge = num % 10;
int shi = num / 10 % 10;
int bai = num /100 ;
System.out.println(“整数”+num+“个位为:”+ge);
System.out.println(“整数”+num+“十位为:”+shi);
System.out.println(“整数”+num+“百位为:”+bai);
}
}
输入一个三位数,求个位十位百位java代码
最新推荐文章于 2024-07-15 08:38:42 发布