只有70分,就只有wa没过了,救救孩子吧
查看原帖
只有70分,就只有wa没过了,救救孩子吧
1030815
bbluele楼主2023/7/4 16:49
#include<iostream>
using namespace std;
int main()
{
    long long x, y, z=0, i;
    cin >> x;
    if (x == 0)
    {
        cout << '0';
    }
    if (x < 0) 
    {
        x = -x;
        cout << "-";
    }  
    while (x != 0)
    {
        if (x % 10 != 0)
            cout << x % 10;
        x /= 10;
    }
}
2023/7/4 16:49
加载中...