Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:7: error: incompatible types: String[] cannot be converted to String String numeros = input.split("\\s+"); ^ Main.java:8: error: array required, but String found int a = Integer.parseInt(numeros[0]); ^ Main.java:9: error: array required, but String found int b = Integer.parseInt(numeros[1]); ^ 3 errors |
||
#2 |
Error de compilación
Main.java:7: error: incompatible types: String[] cannot be converted to String String numeros = input.split("\\s+"); ^ Main.java:8: error: array required, but String found int a = Integer.parseInt(numeros[0]); ^ Main.java:9: error: array required, but String found int b = Integer.parseInt(numeros[1]); ^ 3 errors |
||
#3 |
Error de compilación
Main.java:7: error: incompatible types: String[] cannot be converted to String String numeros = input.split("\\s+"); ^ Main.java:8: error: array required, but String found int a = Integer.parseInt(numeros[0]); ^ Main.java:9: error: array required, but String found int b = Integer.parseInt(numeros[1]); ^ 3 errors |
||
#4 |
Error de compilación
Main.java:7: error: incompatible types: String[] cannot be converted to String String numeros = input.split("\\s+"); ^ Main.java:8: error: array required, but String found int a = Integer.parseInt(numeros[0]); ^ Main.java:9: error: array required, but String found int b = Integer.parseInt(numeros[1]); ^ 3 errors |
||
#5 |
Error de compilación
Main.java:7: error: incompatible types: String[] cannot be converted to String String numeros = input.split("\\s+"); ^ Main.java:8: error: array required, but String found int a = Integer.parseInt(numeros[0]); ^ Main.java:9: error: array required, but String found int b = Integer.parseInt(numeros[1]); ^ 3 errors |
import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); String input = sc.next(); sc.close(); String numeros = input.split("\\s+"); int a = Integer.parseInt(numeros[0]); int b = Integer.parseInt(numeros[1]); System.out.printf("%d\n",a+b); } }