Skip to content

Instantly share code, notes, and snippets.

@pinglunliao
Last active November 5, 2019 08:39
Show Gist options
  • Save pinglunliao/fa71d037daa50c52bb63 to your computer and use it in GitHub Desktop.
Save pinglunliao/fa71d037daa50c52bb63 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
string s = "";
while(cin >> s)
{
char c = s[0];
for(int i = 1; i < s.size(); i++) {
int code = c - s[i];
if(code < 0)
code = -code;
cout << code;
c = s[i];
}
cout << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment