Untitled
unknown
java
a year ago
407 B
17
Indexable
import java.util.Scanner;
public class P1 {
public static float Sol(int n) {
float sum = 0;
int gt = 1;
for (int i = 1; i <= n; i++) {
gt *= i;
sum = (float) Math.pow(sum + gt, 1.0 / (i + 1));
}
return sum;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(Sol(n));
// Sol(n);
}
}Editor is loading...
Leave a Comment