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

Envío 7110

Problema 0x78 - Suma de 2 números

  • Autor: dperezne
  • Fecha: 2023-09-20 00:44:04 UTC (Hace alrededor de 1 año)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.java:1: error: class, interface, or enum expected
 Scanner myObj = new Scanner(System.in);  // Create a Scanner object
 ^
Main.java:2: error: class, interface, or enum expected
    System.out.println("Enter username");
    ^
Main.java:4: error: class, interface, or enum expected
    String userName = myObj.nextLine();  // Read user input
    ^
Main.java:5: error: class, interface, or enum expected
    System.out.println("Username is: " + userName);  // Output user input
    ^
4 errors

                    
#2
Error de compilación
                      Main.java:1: error: class, interface, or enum expected
 Scanner myObj = new Scanner(System.in);  // Create a Scanner object
 ^
Main.java:2: error: class, interface, or enum expected
    System.out.println("Enter username");
    ^
Main.java:4: error: class, interface, or enum expected
    String userName = myObj.nextLine();  // Read user input
    ^
Main.java:5: error: class, interface, or enum expected
    System.out.println("Username is: " + userName);  // Output user input
    ^
4 errors

                    
#3
Error de compilación
                      Main.java:1: error: class, interface, or enum expected
 Scanner myObj = new Scanner(System.in);  // Create a Scanner object
 ^
Main.java:2: error: class, interface, or enum expected
    System.out.println("Enter username");
    ^
Main.java:4: error: class, interface, or enum expected
    String userName = myObj.nextLine();  // Read user input
    ^
Main.java:5: error: class, interface, or enum expected
    System.out.println("Username is: " + userName);  // Output user input
    ^
4 errors

                    
#4
Error de compilación
                      Main.java:1: error: class, interface, or enum expected
 Scanner myObj = new Scanner(System.in);  // Create a Scanner object
 ^
Main.java:2: error: class, interface, or enum expected
    System.out.println("Enter username");
    ^
Main.java:4: error: class, interface, or enum expected
    String userName = myObj.nextLine();  // Read user input
    ^
Main.java:5: error: class, interface, or enum expected
    System.out.println("Username is: " + userName);  // Output user input
    ^
4 errors

                    
#5
Error de compilación
                      Main.java:1: error: class, interface, or enum expected
 Scanner myObj = new Scanner(System.in);  // Create a Scanner object
 ^
Main.java:2: error: class, interface, or enum expected
    System.out.println("Enter username");
    ^
Main.java:4: error: class, interface, or enum expected
    String userName = myObj.nextLine();  // Read user input
    ^
Main.java:5: error: class, interface, or enum expected
    System.out.println("Username is: " + userName);  // Output user input
    ^
4 errors

                    
Puntos totales: 0 / 100

Código

 Scanner myObj = new Scanner(System.in);  // Create a Scanner object
    System.out.println("Enter username");

    String userName = myObj.nextLine();  // Read user input
    System.out.println("Username is: " + userName);  // Output user input