// yukicoder: No.405 ローマ数字の腕時計 // 2019.4.14 bal4u #include #include char s[12][5] = { "XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI" }; int main() { int t, T; char S[10]; scanf("%s%d", S, &T); for (t = 0; t < 12; t++) if (strcmp(S, s[t]) == 0) break; t = (12 + (t + T) % 12) % 12; printf("%s\n", s[t]); return 0; }