public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n", "i", "m(i)"); for(int i = 10; i <= 100; i += 10) System.out.printf("%d\t%f\n", i, getMi(i * 1.0)); } public static double getMi(double number) { double sum = 0; for(int i = 1; i <= number; i++) sum += 4 * (1.0 / (2 * i - 1) - 1.0 / (2 * i + 1)); return sum; } }
相关文章
- 10-30HW5.14