标签:blog os for java 2014 log ad ef as
class multitable{ def makeRowSeq(row: Int) = for(col <- 1 to 10) yield { val prod = (row * col).toString;//prod=行号*列号 val padding = " " * (4 - prod.length);//添加padding个空格 padding + prod } def makeRow(row: Int) = makeRowSeq(row).mkString; def multiTable() = { val tableSeq = for(row <- 1 to 10) yield makeRow(row) tableSeq.mkString("\n"); } }
标签:blog os for java 2014 log ad ef as
原文地址:http://blog.csdn.net/rowanhaoa/article/details/41931243