#include <string>
#include <iostream>
#include <fstream>
#include <vector>
//disables any deprecation warning
#pragma warning(disable : 4996)
//usings
using std::vector;
using std::string;
using std::cout;
string repops(string expr) {
string iexpr = expr;
for (int i = 0; i < iexpr.length(); i++) {
char& c = iexpr[i];
if (c == '+') {
iexpr.replace(i, 1, " add ");
}
if (c == '-') {
iexpr.replace(i, 1, " subtract ");
}
if (c == '*') {
iexpr.replace(i, 1, " multiply ");
}
if (c == '/') {
iexpr.replace(i, 1, " divide ");
}
}
return iexpr;
}
int main() {
cout << repops("1+2-1");
std::cin.get();
return 0;
}
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KCi8vZGlzYWJsZXMgYW55IGRlcHJlY2F0aW9uIHdhcm5pbmcKI3ByYWdtYSB3YXJuaW5nKGRpc2FibGUgOiA0OTk2KQoKLy91c2luZ3MKdXNpbmcgc3RkOjp2ZWN0b3I7CnVzaW5nIHN0ZDo6c3RyaW5nOwp1c2luZyBzdGQ6OmNvdXQ7CgoKc3RyaW5nIHJlcG9wcyhzdHJpbmcgZXhwcikgewogICAgc3RyaW5nIGlleHByID0gZXhwcjsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaWV4cHIubGVuZ3RoKCk7IGkrKykgewoKICAgICAgICBjaGFyJiBjID0gaWV4cHJbaV07CgogICAgICAgIGlmIChjID09ICcrJykgewogICAgICAgICAgICBpZXhwci5yZXBsYWNlKGksIDEsICIgYWRkICIpOwogICAgICAgIH0KICAgICAgICBpZiAoYyA9PSAnLScpIHsKICAgICAgICAgICAgaWV4cHIucmVwbGFjZShpLCAxLCAiIHN1YnRyYWN0ICIpOwogICAgICAgIH0KICAgICAgICBpZiAoYyA9PSAnKicpIHsKICAgICAgICAgICAgaWV4cHIucmVwbGFjZShpLCAxLCAiIG11bHRpcGx5ICIpOwogICAgICAgIH0KICAgICAgICBpZiAoYyA9PSAnLycpIHsKICAgICAgICAgICAgaWV4cHIucmVwbGFjZShpLCAxLCAiIGRpdmlkZSAiKTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gaWV4cHI7Cn0KCmludCBtYWluKCkgewogICAgY291dCA8PCByZXBvcHMoIjErMi0xIik7CiAgICBzdGQ6OmNpbi5nZXQoKTsKICAgIHJldHVybiAwOwp9