scala
青竹梦
在你没有尽全力之前,永远不知道最强的自己有多强!!!
展开
-
scala-简单的模式匹配
csvMap.get(row) match { case Some(y:Map[String, String]) => y.get(list) case None => None }csvMap的数据类型是:Map[String, Map[String, String]]现在我想实现通过row和list关键字,提取出来对应的String。我首先使原创 2014-12-16 15:30:43 · 907 阅读 · 0 评论 -
学习scala-hello-world!
object cfa { def main(args: Array[String]){ println("Hello,world!"); }}很简单的hello,world!原创 2014-12-07 18:13:58 · 728 阅读 · 0 评论 -
scala-第六章-Rational
涉及到的知识点:检查先决条件。函数重载。操作符重载。控制台输入。私有函数。隐式转换。import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStreamRe原创 2014-12-14 21:23:31 · 1929 阅读 · 0 评论 -
scala-第七章-打印9*9乘法口诀表
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 + pr原创 2014-12-14 22:36:25 · 2200 阅读 · 0 评论 -
scala版本的梅森旋转随机数算法
package xzxzimport scala.annotation.tailrecclass MersenneTwister(seed: Int) { private val SIZE: Int = 624 private val PERIOD: Int = 397 private val DIFF: Int = SIZE - PERIOD private de原创 2015-01-01 20:31:20 · 2026 阅读 · 0 评论