import scala.collection.mutableobject Test24_1 {def main(args: Array[String]): Unit = {//1val books=mutable.Set("朝花夕拾","活着")//2books+="三体"println(books)//3books-="三体"//4val rs=books.contains("Python从入门到实践")println(s"Python从入门到实践否存在:${rs}")//5val books2=mutable.Set("朝花夕拾","红楼梦","长歌行")println(books2)val rs2=books2.union(books)println(s"哪些书是他们都有的? ${rs2}")val rs1=books2.intersect(books)println(s"哪些书是他们都有的? ${rs1}")val rs3=books2.diff(books)println(s"哪些书是他们都有的? ${rs3}")} }