/* package whatever; // don't place package name! */
import java.util.* ;
import java.lang.* ;
import java.io.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
//Luis Fernando García Ávalos
Scanner scanner
= new Scanner
( System .
in ) ; System .
out .
println ( "Ingrese el primer número: " ) ; double num1 = scanner.nextDouble ( ) ;
System .
out .
println ( "Ingrese el segundo número: " ) ; double num2 = scanner.nextDouble ( ) ;
System .
out .
println ( "Ingrese el tercer número: " ) ; double num3 = scanner.nextDouble ( ) ;
double suma = num1 + num2 + num3;
double resta = num1 - num2 - num3;
double multiplicacion = num1 * num2 * num3;
double division;
if ( num2 != 0 && num3 != 0 ) {
division = num1 / num2 / num3;
} else {
System .
out .
println ( "Error: División por cero" ) ; }
System .
out .
println ( "Suma: " + suma
) ; System .
out .
println ( "Resta: " + resta
) ; System .
out .
println ( "Multiplicación: " + multiplicacion
) ; System .
out .
println ( "División: " + division
) ;
scanner.close ( ) ;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCS8vTHVpcyBGZXJuYW5kbyBHYXJjw61hIMOBdmFsb3MgClNjYW5uZXIgc2Nhbm5lciA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJJbmdyZXNlIGVsIHByaW1lciBuw7ptZXJvOiAiKTsKICAgICAgICBkb3VibGUgbnVtMSA9IHNjYW5uZXIubmV4dERvdWJsZSgpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiSW5ncmVzZSBlbCBzZWd1bmRvIG7Dum1lcm86ICIpOwogICAgICAgIGRvdWJsZSBudW0yID0gc2Nhbm5lci5uZXh0RG91YmxlKCk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJJbmdyZXNlIGVsIHRlcmNlciBuw7ptZXJvOiAiKTsKICAgICAgICBkb3VibGUgbnVtMyA9IHNjYW5uZXIubmV4dERvdWJsZSgpOwogICAgICAgIAogICAgICAgIGRvdWJsZSBzdW1hID0gbnVtMSArIG51bTIgKyBudW0zOwogICAgICAgIGRvdWJsZSByZXN0YSA9IG51bTEgLSBudW0yIC0gbnVtMzsKICAgICAgICBkb3VibGUgbXVsdGlwbGljYWNpb24gPSBudW0xICogbnVtMiAqIG51bTM7CiAgICAgICAgCiAgICAgICAgZG91YmxlIGRpdmlzaW9uOwogICAgICAgIGlmIChudW0yICE9IDAgJiYgbnVtMyAhPSAwKSB7CiAgICAgICAgICAgIGRpdmlzaW9uID0gbnVtMSAvIG51bTIgLyBudW0zOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGRpdmlzaW9uID0gRG91YmxlLk5hTjsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJFcnJvcjogRGl2aXNpw7NuIHBvciBjZXJvIik7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiU3VtYTogIiArIHN1bWEpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiUmVzdGE6ICIgKyByZXN0YSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJNdWx0aXBsaWNhY2nDs246ICIgKyBtdWx0aXBsaWNhY2lvbik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJEaXZpc2nDs246ICIgKyBkaXZpc2lvbik7CiAgICAgICAgCiAgICAgICAgc2Nhbm5lci5jbG9zZSgpOwoJfQp9