1、scala选择题100道:https://www.cnblogs.com/steamedbundad/p/scalaExercise.html
2、scala练习题:https://blog.csdn.net/World_Programming/article/details/70821782
3、练习题:https://blog.csdn.net/qq_26786555/article/details/50575696
练习1、控制台输入一行字符串,统计分别有多少数字、字母、空格和符号?(元组)
val content=Console.readLine()
val list=content.toCharArray()
def select(char : Char)={
if(char>=48&&char<=57)"num"
else if((char>=65&&char<=90)||(char>=97&&char<=122))"letter"
else if(char==32)"space"
else "others"
}
val a=list.map(select).map((_,1))