//获取一个数的个位 十位 百位 千位
public static void takePlace(){
int intNum = 2108;
int thousand = intNum/1000;//千
int hundred = intNum/100%10;//百
int ten = intNum/10%10;//十
int a= intNum%10;//个
}
获取int类型数据的每一位的数字
最新推荐文章于 2023-11-08 11:11:55 发布