問題文

import java.util.*;

public class Main {
    private Scanner sc;
    private Main() { this.sc = new Scanner(System.in); }
    private void doIt() {
        System.out.printf("Input a number: ");
        double d = sc.nextDouble();
        double res = d;
        for(int i=0; i<100; i++) {
            res = (res + d / res) / 2;
        }
        System.out.printf("%.15f\n", res);
    }

    public static void main(String[] args) { new Main().doIt(); }
}