// S(n) = 1 + 1/2 + 1/3 + ... 1/(n-1) + + 1/n // // S(n) = S(n-1) + 1/n import java.util.Scanner; public class SumFrac { public static double S (int n) { if (n==1) return 1.0; else return S(n-1)+1.0/n; } public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); double f = S(n); System.out.println("the result is:"+f); } }