Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error |
||
#2 |
Error de compilación
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error |
||
#3 |
Error de compilación
|
||
#4 |
Error de compilación
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error |
||
#5 |
Error de compilación
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error |
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String nums = sc.nextLine(); int index=0; for(int i=0; i<nums.length(); i++) { if(nums.charAt(i)==' ') { index=i; break; } } long a= Long.parseLong(nums.substring(0, index)); long b= Long.parseLong(nums.substring(index+1, nums.length())); System.out.println(a+b); } }