#include <iostream>
int main() {
int num = 152;
int units = num % 10; // 获取个位数字
int tens = (num / 10) % 10; // 获取十位数字
int hundreds = num / 100; // 获取百位数字
std::cout << num << " = " << units << " + " << tens << "*10 + " << hundreds << "*100" << std::endl;
return 0;
}
整数152的各位数字
最新推荐文章于 2024-09-14 15:41:03 发布