~cpp #include <iostream> #include<string> using namespace std; int main() { string input; cin >> input; cout << input[0]; for(int i=0;i<input.size() ;i++) { cout << (int)(input[i] - input[0]); } }
~cpp #include <iostream> #include<string> using namespace std; int main() { string input; cin >> input; cout << input[0]; char standard = input[0]; for(int i=0;i<input.size() ;i++) { if((int)(input[i] - standard)<10) cout << (int)(input[i] - standard); else { standard = input[i]; cout << standard; cout << (int)(input[i] - standard); } } }
~cpp #include <iostream> #include<string> using namespace std; int main() { string input; cin >> input; for(int i=1;i<input.size();i++) { cout << (char)(input[0] + (input[i] - '0')); } cout << endl; }
~cpp #include <iostream> #include<string> using namespace std; int main() { string input; cin >> input; char standard = input[0]; for(int i=1;i<input.size();i++) { if(input[i]>='0' && input[i]<='9') cout << (char)(standard + (input[i] - '0')); else { standard = input[i]; cout<<(char)standard; //cout << (char)(standard + (input[i] - '0')); } } cout << endl; }