Skip to content

Instantly share code, notes, and snippets.

@DuqueDeTuring
Last active September 11, 2016 14:27
Show Gist options
  • Save DuqueDeTuring/031836d539944456141713ae48662dc5 to your computer and use it in GitHub Desktop.
Save DuqueDeTuring/031836d539944456141713ae48662dc5 to your computer and use it in GitHub Desktop.
Descubriendo Scala - 1. Programa 1
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