import java.util.Scanner object test { def main(args: Array[String]): Unit = { println("1+...+N, N?") val sc = new Scanner(System.in) val a = sc.nextInt var x = 0 for (c <- 0 to a) { x = x + c } println(x) } }