Java实现:已知有三位数,将其拆分为个位,十位,百位,打印到控制台
package com;
public class Demo13 {
public static void main(String[] args) {
int num = 123;
int ge = 123 / 1 % 10;
System.out.println(ge);
int shi = 123 / 10 % 10;
System.out.println(shi);
int bai = 123 / 100 % 10;
System.out.println(bai);
}
}