object Main extends App {

  for (i <- 1 to 9; j <- 1 to 9) yield Param(i, j).print

  case class Param(x: Int, y: Int) {
    val ans = x * y

    private def format: String = {
      s"${x}x${y}=${ans}"
    }

    def print = println(format)
  }

}