100分,但是第二个任务点#1WA,求dalao指点
查看原帖
100分,但是第二个任务点#1WA,求dalao指点
760418
not_exist楼主2022/8/16 16:30
#include <bits/stdc++.h>
using namespace std;

int main() {
    long long n, c;
    cin >> n;
    if (n < 0) {
        cout << "-";
        n = abs(n);
    }
    bool x = true;
    while (n != 0) {
        c = n % 10;
        if (c == 0 && x) {
            n /= 10;
        } else {
            cout << c;
            n /= 10;
            x = false;
        }
    }
    return 0;
}
2022/8/16 16:30
加载中...