标签:
1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 System.out.printf("%s\t%s\n", "i", "m(i)"); 6 7 for(int i = 10; i <= 100; i += 10) 8 System.out.printf("%d\t%f\n", i, getMi(i * 1.0)); 9 } 10 11 public static double getMi(double number) 12 { 13 double sum = 0; 14 for(int i = 1; i <= number; i++) 15 sum += 4 * (1.0 / (2 * i - 1) - 1.0 / (2 * i + 1)); 16 return sum; 17 } 18 }
标签:
原文地址:http://www.cnblogs.com/wood-python/p/5791222.html