Last active
September 11, 2016 14:27
-
-
Save DuqueDeTuring/031836d539944456141713ae48662dc5 to your computer and use it in GitHub Desktop.
Descubriendo Scala - 1. Programa 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Polinomios { | |
def main(args: Array[String]) { | |
println("Polinomio:") | |
val r = scala.util.Random | |
val grado = 4 | |
val cant_monomios = r.nextInt(grado) + 1 | |
println("\tGrado:" + grado + ", con " + cant_monomios + " monomios.") | |
for(exponente <- 1 to cant_monomios){ | |
println(r.nextInt(10) + "x^" + exponente) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment