Untitled
unknown
java
a year ago
359 B
6
Indexable
import java.util.Scanner;
public class P1 {
public static float Sol(int n) {
float sum = 0;
for (int i = n; i >= 1; i--) {
sum += Math.pow(i, 1.0 / i);
}
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