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

Envío 4432

Problema 0x78 - Suma de 2 números

  • Autor: sergio95it
  • Fecha: 2021-06-20 22:39:58 UTC (Hace casi 3 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.java:6: error: cannot find symbol
    int a = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    int b = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
2 errors

                    
#2
Error de compilación
                      Main.java:6: error: cannot find symbol
    int a = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    int b = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
2 errors

                    
#3
Error de compilación
                      Main.java:6: error: cannot find symbol
    int a = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    int b = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
2 errors

                    
#4
Error de compilación
                      Main.java:6: error: cannot find symbol
    int a = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    int b = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
2 errors

                    
#5
Error de compilación
                      Main.java:6: error: cannot find symbol
    int a = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    int b = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
2 errors

                    
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);
    int a = sc.nextInt;
    int b = sc.nextInt;
    System.out.printf("%d",a+b);
  }
}