Created
March 20, 2018 03:07
-
-
Save vitorizkiimanda/0ce06b66f70062baa17cc5a1242db35c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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