怎么把前面的0给去掉。注意如果逆序后的数有前导0,不用输出前导0,如100,逆序后输出1.
但是如果是40001,不能去掉0
怎么改我的程序
```c++
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x;
scanf("%d", &x);
while (x != 0)
{
printf("%d", x % 10);
x = x / 10;
}
return 0;
}