模拟:先看是否为负数,然后从后向前去除末尾的0最后将字符串反转即可
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
string s;
cin>>s;
if(s[0]=='-'){
while(s.back()=='0'){
s.pop_back();
}
reverse(s.begin()+1,s.end());
}
else{
while(s.back()=='0')
s.pop_back();
reverse(s.begin(),s.end());
}
cout<<s<<endl;
return 0;
}