import java.util.*;
import java.io.*;
import java.text.NumberFormat;
class Ideone
{
{
float x, y;
Scanner input
= new Scanner
(System.
in);
System.
out.
println("Digite o valor de x: ");
try {
x = input.nextFloat();
} catch (InputMismatchException err) {
x = nformat.parse(input.nextLine()).floatValue();
// err.printStackTrace();
}
y = (x - ((x* (x - 1)) / (2* x)));
System.
out.
println("valor calculado por F(x): " + y
); input.close();
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5pby4qOwppbXBvcnQgamF2YS50ZXh0Lk51bWJlckZvcm1hdDsKCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKICAgICAgICBmbG9hdCB4LCB5OwogICAgICAgIAogICAgICAgIE51bWJlckZvcm1hdCBuZm9ybWF0ID0gTnVtYmVyRm9ybWF0LmdldEluc3RhbmNlKExvY2FsZS5HRVJNQU4pOwogICAgICAgIFNjYW5uZXIgaW5wdXQgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgICAgIAogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiRGlnaXRlIG8gdmFsb3IgZGUgeDogIik7CiAgICAgICAgCiAgICAgICAgdHJ5IHsKICAgICAgICAJeCA9IGlucHV0Lm5leHRGbG9hdCgpOwogICAgICAgIH0gY2F0Y2ggKElucHV0TWlzbWF0Y2hFeGNlcHRpb24gZXJyKSB7CiAgICAgICAgCXggPSBuZm9ybWF0LnBhcnNlKGlucHV0Lm5leHRMaW5lKCkpLmZsb2F0VmFsdWUoKTsKICAgICAgICAJLy8gZXJyLnByaW50U3RhY2tUcmFjZSgpOwogICAgICAgIH0KICAgICAgICAKICAgICAgICB5ID0gKHggLSAoKHgqICh4IC0gMSkpIC8gKDIqIHgpKSk7CiAgICAgICAgCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJ2YWxvciBjYWxjdWxhZG8gcG9yIEYoeCk6ICIgKyB5KTsKICAgICAgICBpbnB1dC5jbG9zZSgpOwoJfQp9