含泪求告知哪里有问题
查看原帖
含泪求告知哪里有问题
423591
wangchuanqiushui楼主2020/11/27 20:33

#include using namespace std; int main() { int x; cin >> x; if (x == 0)cout << "0" << endl; else if (x > 0) { if (x % 10 == 0)x /= 10; while (x != 0) { cout << x % 10; x /= 10; } } else { x = -x; cout << "-"; if (x % 10 == 0)x /= 10; while (x != 0) { cout << x % 10; x /= 10; } } return 0; }```c

2020/11/27 20:33
加载中...