标签:port val rgs line exe cal 方式 read object
import scala.io.StdIn object JiShu { def main(args: Array[String]): Unit = { println("请输入一个正整数:") val c:Float= StdIn.readLine().toFloat var s=0.0 var n=1.0 while(s<c){ s=s+(n+1)/n n=n+1 } println("Sn:"+s.formatted("%.6f")) } }
标签:port val rgs line exe cal 方式 read object
原文地址:https://www.cnblogs.com/xuange1/p/12250395.html