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

Envío 6065

Problema 0x78 - Suma de 2 números

  • Autor: Justin
  • Fecha: 2022-05-20 20:11:31 UTC (Hace 8 meses)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.util.Scanner;
^
main.c:1:12: error: expected ';' after top level declarator
import java.util.Scanner;
           ^
           ;
main.c:3:1: error: unknown type name 'public'
public class Multiplicacion{
^
main.c:3:13: error: expected ';' after top level declarator
public class Multiplicacion{
            ^
            ;
4 errors generated.

                    
#2
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.util.Scanner;
^
main.c:1:12: error: expected ';' after top level declarator
import java.util.Scanner;
           ^
           ;
main.c:3:1: error: unknown type name 'public'
public class Multiplicacion{
^
main.c:3:13: error: expected ';' after top level declarator
public class Multiplicacion{
            ^
            ;
4 errors generated.

                    
#3
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.util.Scanner;
^
main.c:1:12: error: expected ';' after top level declarator
import java.util.Scanner;
           ^
           ;
main.c:3:1: error: unknown type name 'public'
public class Multiplicacion{
^
main.c:3:13: error: expected ';' after top level declarator
public class Multiplicacion{
            ^
            ;
4 errors generated.

                    
#4
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.util.Scanner;
^
main.c:1:12: error: expected ';' after top level declarator
import java.util.Scanner;
           ^
           ;
main.c:3:1: error: unknown type name 'public'
public class Multiplicacion{
^
main.c:3:13: error: expected ';' after top level declarator
public class Multiplicacion{
            ^
            ;
4 errors generated.

                    
#5
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import java.util.Scanner;
^
main.c:1:12: error: expected ';' after top level declarator
import java.util.Scanner;
           ^
           ;
main.c:3:1: error: unknown type name 'public'
public class Multiplicacion{
^
main.c:3:13: error: expected ';' after top level declarator
public class Multiplicacion{
            ^
            ;
4 errors generated.

                    
Puntos totales: 0 / 100

Código

import java.util.Scanner;

public class Multiplicacion{

  public static void main(String args[]){
    int a, b;
    Scanner ent = new Scanner(System.in);

    System.out.print("Ingresa el primer valor: ");
    a = ent.nextInt();

    System.out.print("Ingresa el segundo valor: ");
    b = ent.nextInt();

    System.out.print(a + b);
  }
}