#include<bits/stdc++.h> using namespace std; int main() { string a; int i,n=0,m,j=0; while(cin>>a) { j=0; n=0; m=a.length()-1; if(m==0) { printf("%c\n",a[0]); continue; } if(a[0]=='-') { n++; printf("%c",a[0]); } for(i=m;i>=n;i--) { if(a[i]=='0'&&j==0) continue; else j=1; printf("%c",a[i]); } printf("\n"); } } Close
CPP
|