fun main(args: Array<String>) {
val list = arrayListOf<Char>()
val string: String = "731671765313306249192251196744265747423553491"
loop@ for (char in string) {
list.add(char)
if (list.size == 13) {
break@loop
}
}
val trueList = list.map { it.toInt() }
println(list)
println(trueList)
}
每当我尝试将其打印出来时,值都会更改。而不是打印出“ 7、3、1等”,而是打印出“ 55、51、59等”。
这是我所谈论的内容的摘要。我先打印了字符列表,然后打印了整数列表。
[7, 3, 1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3] // List of the characters
[55, 51, 49, 54, 55, 49, 55, 54, 53, 51, 49, 51, 51] // List of integers
答案 0 :(得分:1)