103-19 Karimov SHerozjon
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
float a0= 1.0f, a1 = 0.0f;
for(int k=1;k<=n;k++){
a1 = a0*(float)k + 1.0f / (float)k;
a0 = a1;
}
System.out.print(a1);
}
}
Do'stlaringiz bilan baham: |