Post History
C (gcc), 64 62 bytes Saved 2 bytes thanks to m90 in the comments. i;f(char*s){i=atoi(s)>>4;return'A'+(i&8?i&4?i&2?i%2+3:2:1:0);} Try it online!
Answer
#2: Post edited
# [C (gcc)], 64 bytes- <!-- language-all: lang-c -->
i;f(char*s){i=atoi(s)>>4;return'A'+(i&8?i&4?i&2?i&1?4:3:2:1:0);}[Try it online!][TIO-kx84gk1v]- [C (gcc)]: https://gcc.gnu.org/
[TIO-kx84gk1v]: https://tio.run/##hc7JCsIwEAbgu08RCtbEZUim6Y6WuryFlxKs5mCUWE/is9couByqEv6BGT5@oiZbpdpW5zVVu8oOT@yip1Vz0PTEZjOZ201ztmZQDkZU@0mhfemCLqKQWZBhJjLO8murTUP2lTaU9S49Qo7WHWrq9RWZknJtvDFxm@CAHAIOknuM5d8dxsDdE11q/lYJCIQgcDP@LVMBaQoYyu7KxRsiiCgBidDZuHxCRPn9h6uXkvxeFaUg/sAwhI887LW9AQ "C (gcc) – Try It Online"
- # [C (gcc)], <s>64</s> 62 bytes
- Saved 2 bytes thanks to [m90][m90] in the [comments.][comment]
- <!-- language-all: lang-c -->
- i;f(char*s){i=atoi(s)>>4;return'A'+(i&8?i&4?i&2?i%2+3:2:1:0);}
- [Try it online!][TIO-kxcxfz6o]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kxcxfz6o]: https://tio.run/##hc7NCsIwDAfw@56iDDZbp6FNO90HU/x6Cy@jOO3BKXOeZM8@q6DzMJWQQMKPP9HjvdZta9KC6kNeDS/sZrK8Phl6YbOZSqtdfa3KwWIQUONHc@Mr2zg3HgYywUQknKVNa8qaHHNTUubcHELOlT0U1PU0ychiW7ojYjfBATlIDoq7jKXfHU6B2xJ9atmpCASClHZOf8tYQBwDhqo/ctVBBDGJQCH0Jq5fEFF9/3DzVoo/oiYxiD8wDOGjn7Zp7w "C (gcc) – Try It Online"
- [m90]: https://codegolf.codidact.com/users/54227
- [comment]: https://codegolf.codidact.com/comments/thread/5400#comment-15469
#1: Initial revision
# [C (gcc)], 64 bytes <!-- language-all: lang-c --> i;f(char*s){i=atoi(s)>>4;return'A'+(i&8?i&4?i&2?i&1?4:3:2:1:0);} [Try it online!][TIO-kx84gk1v] [C (gcc)]: https://gcc.gnu.org/ [TIO-kx84gk1v]: https://tio.run/##hc7JCsIwEAbgu08RCtbEZUim6Y6WuryFlxKs5mCUWE/is9couByqEv6BGT5@oiZbpdpW5zVVu8oOT@yip1Vz0PTEZjOZ201ztmZQDkZU@0mhfemCLqKQWZBhJjLO8murTUP2lTaU9S49Qo7WHWrq9RWZknJtvDFxm@CAHAIOknuM5d8dxsDdE11q/lYJCIQgcDP@LVMBaQoYyu7KxRsiiCgBidDZuHxCRPn9h6uXkvxeFaUg/sAwhI887LW9AQ "C (gcc) – Try It Online"