/* 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
{
public static double leerDouble(Scanner reader) {
return reader.nextDouble();
}
public static double suma(double x, double y){
double suma = x + y;
return suma;
}
static double resta(double x, double y){
double resta = x - y;
return resta;
}
static double multiplica(double x, double y){
double multiplica = x * y;
return multiplica;
}
static double cuadrado(double x){
double cuadrado
= Math.
sqrt(x
); return cuadrado;
}
Scanner lectura
= new Scanner
(System.
in); double x = leerDouble(lectura);
double y = leerDouble(lectura);
//operaciones:
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
));
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgZG91YmxlIGxlZXJEb3VibGUoU2Nhbm5lciByZWFkZXIpIHsKICAgICAgICByZXR1cm4gcmVhZGVyLm5leHREb3VibGUoKTsKICAgIH0KICAgIAoJcHVibGljIHN0YXRpYyBkb3VibGUgc3VtYShkb3VibGUgeCwgZG91YmxlIHkpewoJCWRvdWJsZSBzdW1hID0geCArIHk7CgkJcmV0dXJuIHN1bWE7Cgl9CgoJc3RhdGljIGRvdWJsZSByZXN0YShkb3VibGUgeCwgZG91YmxlIHkpewoJCWRvdWJsZSByZXN0YSA9IHggLSB5OwoJCXJldHVybiByZXN0YTsKCX0KCglzdGF0aWMgZG91YmxlIG11bHRpcGxpY2EoZG91YmxlIHgs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