Looking for an inspiration? Below you will find public programs submitted by other users.

Filter by: All Bash C C# C++ 5.1 C++14 Haskell Java Java7 Objective-C Pascal (fpc) Pascal (gpc) Perl PHP Python Python 3 Ruby SQL VB.NET Ada Assembler Assembler AWK (gawk) AWK (mawk) bc Brainf**k C C++ C++ 4.3.2 C99 strict CLIPS Clojure COBOL COBOL 85 CoffeeScript Common Lisp (clisp) D D D (dmd) Elixir Erlang F# Factor Falcon Fantom Forth Fortran Go Groovy Icon Intercal JavaScript (rhino) JavaScript (spidermonkey) Lua Nemerle Nice Nim Node.js Objective-C Ocaml Octave Oz Perl 6 PicoLisp Pike Prolog (gnu) Prolog (swi) Python (Pypy) R Rust Scala Scheme (chicken) Scheme (guile) Smalltalk Tcl Text Unlambda Whitespace

#OjdhBG Scala 3 hours ago
Compilation error
  1. object CaseClassInheritance {
  2. abstract class Person {
  3. def name: String
  4. def age: Int
  5. // address and other properties
  6. // methods (ideally only accessors since it is a case class)
  7. def getName(): String = {
  8. return name
  9. }
#xPiUwM Scala 4 hours ago
Success
  1. import java.util.Scanner
  2.  
  3. import scala.util.control.Breaks
  4.  
  5. object Main {
  6. def main(args: Array[String]): Unit = {
  7. var N: Int = 0
  8. var X: Int = 0
  9. var Y: Int = 0
#xfeUIs Scala 4 hours ago
Success
  1. object Main extends App {
  2. // your code goes here
  3. println("hoge")
  4. }
#0cT7w8 Scala 4 hours ago
Compilation error
  1. object Main extends App {
  2. plintln("hoge")
  3. }
#ZK7ePK Scala 15 hours ago
Success
  1. import scala.io.StdIn.{readLine,readInt}
  2.  
  3. object Main {
  4. def main(args: Array[String]) {
  5. println("Hello, world!")
  6. val times = readInt();
  7. for( i <- 0 until times ) {
  8. val N = readInt();
  9. val sp = readLine().split(" ");
#k6YYkD Scala 20 hours ago
Success
  1. object Main extends App {
  2. // your code goes here
  3.  
  4. sealed trait Intersection
  5. case object NoIntersection extends Intersection
  6. case class SinglePoint(p: String) extends Intersection
  7.  
  8. override def main(argv: Array[String]) = {
  9. println("ok")
#kPJB3r Scala 23 hours ago
Success
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#jjk1x4 Scala 23 hours ago
Success
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#OsJij0 Scala 23 hours ago
Success
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#jWwtsV Scala 23 hours ago
Success
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#pBWtlQ Scala 23 hours ago
Success
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#77n8lA Scala 23 hours ago
Success
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#ySdgZG Scala 23 hours ago
Runtime error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#D2xn8U Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#POowtq Scala 23 hours ago
Runtime error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#6Jfqzi Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#ikiHsv Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(eggs: Int, floors: Int): Int = {
  5. val memo = Array.ofDim[Int](eggs+1, floors+1)
  6. for (f <- 2 to floors) memo(0)(f) = inf
  7. for (e <- 0 to eggs) {
  8. memo(e)(0) = 0
  9. memo(e)(1) = 0
#pDrBKp Scala 23 hours ago
Runtime error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(e: Int, f: Int): Int = {
  5. val memo = Array.ofDim[Int](e+1, f+1)
  6. for (j <- 2 to f) memo(0)(j) = inf
  7. for (i <- 0 to e) {
  8. memo(i)(0) = 0
  9. memo(i)(1) = 0
#LL9pA1 Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(e: Int, f: Int): Int = {
  5. import scala.math
  6. val memo = Array.ofDim[Int](e+1, f+1)
  7. for (j <- 2 to f) memo(0)(j) = inf
  8. for (i <- 0 to e) {
  9. memo(i)(0) = 0
#7xUvbX Scala 23 hours ago
Success
  1. object Main extends App {
  2. var line = readLine();
  3. while(false == line.equals("42")) {
  4. System.out.println(line);
  5. line = readLine();
  6. };
  7. }
#kejGsk Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(e: Int, f: Int): Int = {
  5. using scala.math
  6. val memo = Array.ofDim[Int](e+1, f+1)
  7. for (j <- 2 to f) memo(0)(j) = inf
  8. for (i <- 0 to e) {
  9. memo(i)(0) = 0
#K2v0UZ Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(e: Int, f: Int): Int = {
  5. val memo = Array.ofDim[Int](e+1, f+1)
  6. for (j <- 2 to f) memo(0)(j) = inf
  7. for (i <- 0 to e) {
  8. memo(i)(0) = 0
  9. memo(i)(1) = 0
#23jJF1 Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. val inf = 1e7.toInt
  3.  
  4. def m(e: Int, f: Int): Int = {
  5. val memo = Array.ofDim[Int](e+1, f+1)
  6. for (j <- 2 to f) memo(0)(j) = inf
  7. for (i <- 0 to e) {
  8. memo(i)(0) = 0
  9. memo(i)(1) = 0
#n6WjXX Scala 23 hours ago
Success
  1. object Main extends App {
  2. def m(e: Int, f: Int): Int = {
  3. val memo = Array.ofDim[Int](e+1, f+1)
  4. for (j <- 2 to f) memo(0)(j) = 1e7.toInt
  5. for (i <- 0 to e) {
  6. memo(i)(0) = 0
  7. memo(i)(1) = 0
  8. }
  9.  
#chEPfK Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. def m(e: Int, f: Int): Int = {
  3. val memo = Array.ofDim[Int](e+1, f+1)
  4. for (j <- 2 to f) memo(0)(j) = 1e7
  5. for (i <- 0 to e) memo(i)(0) = memo(i)(1) = 0
  6.  
  7. 42
  8. }
  9. }
#KBSh17 Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. def m(e: Int, f: Int): Int = {
  3. val memo = Array.ofDim[Int](e+1, f+1)
  4. for (j <- 2 to f) memo(0, j) = 1e7
  5. for (i <- 0 to e) memo(i, 0) = memo(i, 1) = 0
  6.  
  7. 42
  8. }
  9. }
#CV8H2U Scala 23 hours ago
Compilation error
  1. object Main extends App {
  2. def m(e: Int, f: Int): Int = {
  3. val memo = Array.ofDim[Int](e+1, f+1)
  4. for (j : 2 to f) memo(0, j) = 1e7
  5. for (i : 0 to e) memo(i, 0) = memo(i, 1) = 0
  6.  
  7. 42
  8. }
  9. }
#DhWF6e Scala 23 hours ago
Success
  1. object Main extends App {
  2. var line = readLine();
  3. while(false == line.equals("42")) {
  4. System.out.println(line);
  5. line = readLine();
  6. };
  7. }
#fEJj2g Scala 1 day ago
Success
  1. object Main extends App {
  2. def repeatedParameterMethod(x: Int, y: String, z: Any*) = {
  3. "%d %ss can give you %s".format(x, y, z.mkString(", "))
  4. }
  5. print( repeatedParameterMethod(3, "egg", List("a delicious sandwich", "protein", "high cholesterol")) )
  6. }
#xNzQJh Scala 1 day ago
Success
  1. object Main extends App {
  2. def foo(x:Object){ return x.asInstanceOf[A with IB]}
  3. foo(new SubA());
  4. foo(new A());
  5. }
  6. class A{}
  7. trait IB{}
  8. class SubA extends A with IB{}