fun main() { val poemArray:Array
= arrayOf("朝辞彩云间", "千里江陵一日还", "两岸猿声啼不住", "轻舟已过") var poem:String="" var i:Int = 0 while (i < poemArray.size) { if (i%2 ==0) { poem = "$poem${poemArray[i]},\n" } else { poem = "$poem${poemArray[i]}。\n" } i++ } poem = "${poem}该诗歌一共有${i}句。" println(poem) }