Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <string>
- using namespace std;
- template <typename X>
- inline X abs(const X &a) { return a < 0 ? -a : a; }
- string convert(char c){
- int t = int(c);
- string res = "";
- while (t){
- res += '0'+(t%10);
- t /= 10;
- }
- reverse(res.begin(), res.end());
- return res;
- }
- int main()
- {
- string s;
- cin >> s;
- for(int i = 0; i < s.length(); i++)
- {
- string t = convert(s[i]);
- s.insert(i+1, t);
- i+= t.length();
- }
- cout << s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement