摘要: 1.求和 def sum(num: Int): Int = if (num == 1) 1 else num + sum(num - 1) 2.求最大值 def max(list: List[Int]): Int = { if (list.size == 1) { list.head } else 阅读全文
posted @ 2020-05-03 16:24 地中有山 阅读(318) 评论(0) 推荐(0) 编辑