蒟蒻作死勿喷www
#include<cstdio>
#include<stack>
#include<cstdlib>
#include<cstring>
using namespace std;
int main(){
stack<int>sta;
char str[10],s[2];
bool flag=false;
scanf("%s",str);
if(atoi(str)==0){
printf("0");
return 0;
}
if(str[0]=='-')flag=true;
if(flag){
for(int i=1;i<strlen(str);i++){
s[0]=str[i];
sta.push(atoi(s));
}
}
else{
for(int i=0;i<strlen(str);i++){
s[0]=str[i];
sta.push(atoi(s));
}
}
if(flag)printf("-");
while(!sta.empty()){
while(sta.top()==0)sta.pop();
printf("%d",sta.top());
sta.pop();
}
return 0;
}