Skip to content

Instantly share code, notes, and snippets.

@vitorizkiimanda
Created March 20, 2018 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitorizkiimanda/0ce06b66f70062baa17cc5a1242db35c to your computer and use it in GitHub Desktop.
Save vitorizkiimanda/0ce06b66f70062baa17cc5a1242db35c to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main() {
string input;
vector<char> result;
getline(cin,input);
if(input.length()==1){
cout << input << endl;
}
else {
for(int i=0;i<input.length();i++){
if(input[i]=='+' or input[i]==' ' or input[i]=='(' or input[i]==')' or input[i]=='-' or input[i]=='*' or input[i]=='?' or input[i]=='.' or input[i]=='/' )
{
input.erase(i,1);
i--;
}
if(input[i]=='0' and i>1){
input.erase(i,1);
}
if(input[i]=='0' and i<1){
input.erase(i,1);
input.insert(i,"62");
}
}
cout << input <<endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment