fork download
  1. //A116г
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class ThirdLab
  8. {
  9. public static void main (String[] args)
  10. {
  11. Scanner input = new Scanner(System.in);
  12. double x, mult = 1;
  13. int n, k, fact = 1;
  14.  
  15. n = input.nextInt();
  16. x = input.nextDouble();
  17.  
  18. for(k = 1; k <= n; k++)
  19. {
  20. fact *= k;
  21. mult *= 1 + (Math.sin(k*x)/fact);
  22. }
  23.  
  24. System.out.printf("%.4f", mult);
  25. }
  26. }
Success #stdin #stdout 0.08s 4386816KB
stdin
7
0.76
stdout
2.8456