Advertisement
AntonioVillanueva

Cajas de seguridad

Dec 10th, 2021
1,216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.43 KB | None | 0 0
  1. mport java.util.Scanner
  2.  
  3. fun main() {
  4.  
  5.     val lector = Scanner(System.`in`)
  6.     var cajasDeSeguridad = MutableList(4) {MutableList(4) { 0 }}
  7.     var fila =lector.nextInt()
  8.     var columna =lector.nextInt()
  9.  
  10.     while (fila != -1 && columna !=-1 ) {
  11.  
  12.         cajasDeSeguridad[fila][columna]++
  13.  
  14.         fila = lector.nextInt()
  15.         if (fila == -1) break //Evita escribir dos veces -1
  16.         columna = lector.nextInt()
  17.     }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement