int n = 1234;
int qian = n/1000;
int bai= n%1000/100;
int shi = n%100/10;
int ge = n%10;
System.out.println(qian+"\t"+bai+"\t"+shi+"\t"+ge);
取千位,百位,十位,个位
最新推荐文章于 2024-07-14 17:40:12 发布
int n = 1234;
int qian = n/1000;
int bai= n%1000/100;
int shi = n%100/10;
int ge = n%10;
System.out.println(qian+"\t"+bai+"\t"+shi+"\t"+ge);