package com.uu.one
import scala.collection.mutable.ListBuffer
import scala.util.control.Breaks
object Demo1 {
def main(args: Array[String]): Unit = {
val sentence = "一首现代诗《笑里藏刀》:哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈刀哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
val map = scala.collection.mutable.HashMap[Char,Int]()
sentence.foreach(x=>{
val value = map.getOrElse(x, 0)
if (value == 0) map.put(x,1) else map.put(x,1+value)
})
println(map)
}
}