Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // kotlin solution to codeabbey challenge 72
- fun main(args: Array<String>) {
- var INP1 = readLine()!!.split(" ").map { it.toInt() }
- var INP2 = readLine()!!.split(" ").map { it.toInt() }
- var CON = "bcdfghjklmnprstvwxz"
- var VOW = "aeiou"
- var A = 445
- var C = 700001
- var M = 2097152
- var XN = INP1[1]
- var LI = 0
- var RSP = mutableListOf<String>()
- for (wl in INP2){
- var WORD = ""
- for (i in 1 until wl+1){
- XN = (A*XN + C) % M
- if (i % 2 == 0){
- LI = XN % 5
- WORD += VOW[LI]
- }else{
- LI = XN % 19
- WORD = WORD + CON[LI]
- }
- }
- RSP.add(WORD)
- }
- println(RSP.joinToString(" "))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement