import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    static double S(int a, int b) {
        double th1 = 1.0,th2=0,th3=0,th4=0;
        for (int i = 0; i < b; i++) {
            th4 = 0;
            while (th4 < a) {
                th2 = th3;
                th3 = th3 + th1;
                th4 = th3 * th3;
            }
            th1 = th1 * 0.1;
            th3 = th2;
        }
        return th3;
    }

    public static void main(String[] args) {
        System.out.printf("%f", S(2,10));
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: