fork download
  1. object Main extends App {
  2. // your code goes here
  3. val x = 45
  4. println(s"Hex: ${Integer.toHexString(x)}")
  5. println(s"Binary: ${Integer.toBinaryString(x)}")
  6.  
  7. println(Integer.decode("0x700045802082101F"))
  8.  
  9. }
Runtime error #stdin #stdout #stderr 0.37s 322240KB
stdin
Standard input is empty
stdout
Hex: 2d
Binary: 101101
stderr
Exception in thread "main" java.lang.NumberFormatException: For input string: "700045802082101F"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:583)
	at java.lang.Integer.valueOf(Integer.java:740)
	at java.lang.Integer.decode(Integer.java:1197)
	at Main$.delayedEndpoint$Main$1(Main.scala:7)
	at Main$delayedInit$body.apply(Main.scala:1)
	at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App$$anonfun$main$1.apply(App.scala:76)
	at scala.App$$anonfun$main$1.apply(App.scala:76)
	at scala.collection.immutable.List.foreach(List.scala:381)
	at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
	at scala.App$class.main(App.scala:76)
	at Main$.main(Main.scala:1)
	at Main.main(Main.scala)