试题详情
单项选择题scala中下面对于For循环打印出来说法正确的是?()

A、for(i<-1to10){print(i)}输出1-1010个数字

B、for(i<-1until10){print(i)}输出1-1010个数字

C、for(i<-1.to(10)){print(i)}程序编译有错误没有.to(10)这种写法

D、for(inti=1;i<=10;i++){print(i)}输出1-1010个数字

  • A
  • 关注下方微信公众号,在线模考后查看

热门试题