13.7 匹配元组
package com.atguigu.day11.moshipipei
object MatchTuple {
def main(args: Array[String]): Unit = {
// val tup1: (Int, Int) = (10, 20)
val tup1: (Int, Int, Int) = (10, 20, 30)
tup1 match {
// 匹配第一个是10的两个元素的元组
// case (10, _) => println("(10, _)")
//
// case (_, _, 30) => println("_, _, 30")
case (a, b, c) => println(a + " " + b + " " + c)
case _ => println("啥都不匹配")
}
}
}