█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 4437

Problema 0x78 - Suma de 2 números

  • Autor: sergio95it
  • Fecha: 2021-06-20 23:35:44 UTC (Hace casi 3 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at Main.main(Main.java:10)
0.118 s 14 KBi
#2
Error interno
No such file or directory @ rb_sysopen - /box/Main.java
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at Main.main(Main.java:10)
0.175 s 13 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at Main.main(Main.java:10)
0.162 s 13 KBi
#5
Error interno
No such file or directory @ rb_sysopen - /box/Main.java
Puntos totales: 0 / 100

Código

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    
    String input = sc.next();
    String nums[]= input.split("\\s+");
    
    int a = Integer.parseInt(nums[0]);
    int b = Integer.parseInt(nums[1]);

    System.out.printf("%d",a+b);  
  }
}