object Problem {
def main(args: Array[String]): Unit = {
List.range(1, 101).map(x => func(x)).map(x => println(x))
}
def func(x: Integer) = (x % 5, x % 3, x) match {
case (0, 0, _) => "C"
case (0, _, _) => "B"
case (_, 0, _) => "A"
case _ => x.toString
}
}
뭔가 문제풀이 분위기에 동참!
ㅋㅋ
귀찮을 땐 패턴매칭 원츄~