void spilit(int num){
int n = num;
int cnt = 0;//数位
int temp, power;
while(num){
num = num / 10;
cnt++;
}
for(int i = 1; i <= cnt; i++){
power = pow(10.0, cnt - i);
temp = n / power;
cout << temp << endl;
n = n % power;
}
}
数位拆分
最新推荐文章于 2024-03-26 19:08:29 发布