Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main ()
- {
- string s;
- cin >> s;
- int i, j, k, l, x, y;
- int sz = s.size();
- s[0]=s[0]--;
- if (s[0]=='0')
- {
- cout << 1;
- for (i=1; i<sz; i++)
- {
- cout << s[i];
- }
- for (i=sz-1; i>=1; i--)
- {
- cout << s[i];
- }
- cout << 1;
- }
- else
- {
- for (i=0; i<sz; i++)
- {
- cout << s[i];
- }
- for (i=sz-1; i>=0; i--)
- {
- cout << s[i];
- }
- }
- return 0;
- }
- close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement