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

Envío 402

Problema 0x78 - Suma de 2 números

  • Autor: datruq
  • Fecha: 2020-09-01 17:59:49 UTC (Hace más de 4 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.java:6: error: unclosed string literal
    System.out.println("Enter the numbers to 
                       ^
Main.java:7: error: ';' expected
      be calculated: ");
                   ^
Main.java:7: error: unclosed string literal
      be calculated: ");
                     ^
3 errors

                    
#2
Error de compilación
                      Main.java:6: error: unclosed string literal
    System.out.println("Enter the numbers to 
                       ^
Main.java:7: error: ';' expected
      be calculated: ");
                   ^
Main.java:7: error: unclosed string literal
      be calculated: ");
                     ^
3 errors

                    
#3
Error de compilación
                      Main.java:6: error: unclosed string literal
    System.out.println("Enter the numbers to 
                       ^
Main.java:7: error: ';' expected
      be calculated: ");
                   ^
Main.java:7: error: unclosed string literal
      be calculated: ");
                     ^
3 errors

                    
#4
Error de compilación
                      Main.java:6: error: unclosed string literal
    System.out.println("Enter the numbers to 
                       ^
Main.java:7: error: ';' expected
      be calculated: ");
                   ^
Main.java:7: error: unclosed string literal
      be calculated: ");
                     ^
3 errors

                    
#5
Error de compilación
                      Main.java:6: error: unclosed string literal
    System.out.println("Enter the numbers to 
                       ^
Main.java:7: error: ';' expected
      be calculated: ");
                   ^
Main.java:7: error: unclosed string literal
      be calculated: ");
                     ^
3 errors

                    
Puntos totales: 0 / 100

Código

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner numbers = new Scanner(System.in); 
    System.out.println("Enter the numbers to 
      be calculated: ");
    long firstNumeber = numbers.nextLong();
    long secondNumber = numbers.nextLong();
    long result = firstNumeber + secondNumber;
    System.out.println("La suma es: " + 
      result);
  }
}