これがベトナム大学院の実態だ!

Trường Đại Học Bách Khoa Thành Phố Hồ Chí Minhの大学院修士課程に社会人入学

20160328 Nguyên lý ngôn ngữ lập trình

package exercise

trait FP {

// Q1
def recLstSquare(n:Int):List[Int]={
if(n==1) List(1)
return recLstSquare(n-1) ++ List(n*n)
}
def recHelpLstSquare(n1:Int,n2:Int):List[Int] = {
if(n1==n2) List(n2*n2)
else (n1*n1)::recHelpLstSquare(n1+1, n2)
}

def higLstSquare(n:Int)= recHelpLstSquare(1,n)
// Q2
def recPow(x:Double,n:Int):Double = 0
def higPow(x:Double,n:Int) = null
// Q3
def recAppend(a:List[Int],b:List[Int]):List[Int] = null
def recReverse(a:List[Int]):List[Int] = null
def higAppend(a:List[Int],b:List[Int]) = null
def higReverse(a:List[Int]):List[Int] = null
// Q4
def recLessThan(n:Int,lst:List[Int]):List[Int] = null
def higLessThan(n:Int,lst:List[Int]) = null

// Q5
case class A(n:String,v:Int)
case class B(x:Int,y:A)
def lookup[T](n:String,lst:List[T],f:T=>String):Option[T] = null
}

object Main {
def main(args: Array[String]) {
//debug message
println("This is a main functuion")
val LnSqare = new Array[Int](10)
}
}