cccckick @ 2024-12-09 22:30:22
#include <bits/stdc++.h>
using namespace std;
#define int long long
string a;
signed main()
{
cin>>a;
if(a[0]=='-')
reverse(a.begin()+1,a.end());
else
reverse(a.begin(),a.end());
while(a[0]=='0')
a.erase(0,1);
for(auto it: a)
cout<<it;
}
by j2k183 @ 2024-12-09 22:38:02
如果-
,需要分讨
by cccckick @ 2024-12-09 23:04:36
@j2k183谢谢