AtCoder Beginner Contest 056: A - HonestOrDishonest

,

http://abc056.contest.atcoder.jp/tasks/abc056_a

急にStandard MLしたくなったので。文字literalが#"c"なのが独特。

implementation

fun solve(#"H", b) = b
|   solve(#"D", #"H") = #"D"
|   solve(#"D", #"D") = #"H"

fun readChar() = TextIO.scanStream Char.scan TextIO.stdIn
val SOME a = readChar()
val SOME #" " = readChar()
val SOME b = readChar()
val () = print(Char.toString(solve(a, b)) ^ "\n")