// yukicoder: No.632 穴埋め門松列 // 2019.5.1 bal4u #include #include #define gc() getchar() #define pc(c) putchar(c) void outs(char *s) { while (*s) pc(*s++); } char s[6][4] = {"23?", "2?3", "32?", "3?2", "?23", "?32"}; char ans[6][3] = {"1", "14", "4", "14", "4", "1"}; char a[5]; int main() { int i; for (i = 0; i < 3; i++) a[i] = gc(), gc(); for (i = 0; i < 6; i++) { if (strcmp(s[i], a) == 0) { outs(ans[i]), pc('\n'); break; } } return 0; }