Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scala.io.Source
- object IO extends App {
- do {
- println("I can has multiply?")
- val param = Console.readLong()
- printMult(param)
- println("Type y to repeat.")
- } while (Console.readChar() != 'n')
- def printMult(mult: BigInt): Unit = {
- var sum : BigInt = 0
- for (i <- (1 to 10)) {
- println(i + "\t" + i * mult);
- sum += i * mult;
- }
- println("Sum: " + sum)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement