You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
306 B
14 lines
306 B
2 years ago
|
#include <bits/stdc++.h>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
string num;
|
||
|
cin >> num;
|
||
|
if (num[0] == '-') cout << '-', num = num.substr(1);
|
||
|
reverse(num.begin(), num.end());
|
||
|
while (num.size() > 1 && num[0] == '0') num = num.substr(1);
|
||
|
cout << num << endl;
|
||
|
|
||
|
return 0;
|
||
|
}
|