#include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
if (str[0] == '-')
printf("-"), str.erase(str.begin());
int index = 0;
for (int i = str.size() - 1; i >= 0; i--)
if (str[i] != '0') {
index = i;
break;
}
for (int i = index; i >= 0; i--)
printf("%c", str[i]);
return 0;
}
P1307(数字反转)
最新推荐文章于 2024-01-22 22:48:21 发布