题解 | #计算某字符出现次数#
计算某字符出现次数
https://www.nowcoder.com/practice/a35ce98431874e3a820dbe4b2d0508b1
import java.util.Scanner fun main(args: Array<String>) { val `in` = Scanner(System.`in`) val a = mutableListOf<String>() while (`in`.hasNextLine()) { a.add(`in`.nextLine()) if (a.size == 2) { val b = a[0] val c = a[1] println(b.count { it.toLowerCase() == c[0].toLowerCase() }) a.clear() } } }#kotlin#