| //https://www.acmicpc.net/problem/5218 #include <iostream> |
| #include <string> |
| using namespace std; |
| int main() |
| { |
| int N; |
| cin >> N; |
| for(int i=0; i<N; i++) |
| { |
| string s1,s2; |
| cin >> s1 >> s2; |
| cout << "Distances: " ; |
| int l=s1.size(); |
| for(int j=0;j<l; j++) |
| { |
| if((int)s1[j]>(int)s2[j]) cout << s2[j]-s1[j] +26 << " "; |
| else cout << s2[j]-s1[j] << " "; |
| } |
| cout << endl; |
| } |
| } |
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
| 171212_6603_로또 (0) | 2017.12.12 |
|---|---|
| 171211_5586_JOI와 IOI (0) | 2017.12.11 |
| 171210_11054_가장 긴 바이토닉 부분 수열 (0) | 2017.12.10 |
| 171210_11053_가장 긴 증가하는 부분 수열 (0) | 2017.12.10 |
| 171209_11722_가장 긴 감소하는 부분 수열 (0) | 2017.12.09 |