import java.util.Scanner;
class Parametros {
Scanner lectura
= new Scanner
(System.
in); double x = leerDouble(lectura);
double y = leerDouble(lectura);
System.
out.
println("resta: " + resta
(x, y
)); System.
out.
println("suma: " + suma
(x, y
)); System.
out.
println("multiplica: " + multiplica
(x, y
)); System.
out.
println("cuadrado: " + cuadrado
(x
)); }
static double suma(double n, double m) {
return n + m;
}
static double resta(double n, double m) {
return n - m;
}
static double multiplica(double n, double m) {
return n * m;
}
static double cuadrado(double n) {
return n * n;
}
public static double leerDouble(Scanner reader) {
System.
out.
println("Ingrese un numero de tipo double: "); return reader.nextDouble();
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgUGFyYW1ldHJvcyB7CiAgICAKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uIHsKICAgICAgICBTY2FubmVyIGxlY3R1cmEgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgICAgIGRvdWJsZSB4ID0gbGVlckRvdWJsZShsZWN0dXJhKTsKICAgICAgICBkb3VibGUgeSA9IGxlZXJEb3VibGUobGVjdHVyYSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKHgpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbih5KTsKICAgICAgICAKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oInJlc3RhOiAiICsgcmVzdGEoeCwgeSkpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigic3VtYTogIiArIHN1bWEoeCwgeSkpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigibXVsdGlwbGljYTogIiArIG11bHRpcGxpY2EoeCwgeSkpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiY3VhZHJhZG86ICIgKyBjdWFkcmFkbyh4KSk7CiAgICB9CgogICAgc3RhdGljIGRvdWJsZSBzdW1hKGRvdWJsZSBuLCBkb3VibGUgbSkgewogICAgICAgIHJldHVybiBuICsgbTsKICAgIH0KCiAgICBzdGF0aWMgZG91YmxlIHJlc3RhKGRvdWJsZSBuLCBkb3VibGUgbSkgewogICAgICAgIHJldHVybiBuIC0gbTsKICAgIH0KCiAgICBzdGF0aWMgZG91YmxlIG11bHRpcGxpY2EoZG91YmxlIG4sIGRvdWJsZSBtKSB7CiAgICAgICAgcmV0dXJuIG4gKiBtOwogICAgfQoKICAgIHN0YXRpYyBkb3VibGUgY3VhZHJhZG8oZG91YmxlIG4pIHsKICAgICAgICByZXR1cm4gbiAqIG47CiAgICB9CgogICAgcHVibGljIHN0YXRpYyBkb3VibGUgbGVlckRvdWJsZShTY2FubmVyIHJlYWRlcikgewogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiSW5ncmVzZSB1biBudW1lcm8gZGUgdGlwbyBkb3VibGU6ICIpOwogICAgICAgIHJldHVybiByZWFkZXIubmV4dERvdWJsZSgpOwogICAgfQp9