1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 double sum = 0; 6 7 for(int i = 1; i <= 97; i += 2) 8 sum += (i * 1.0) / ((i + 2) * 1.0); 9 10 System.out.println("sum is " + sum); 11 } 12 }
时间: 2024-10-11 07:32:03
1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 double sum = 0; 6 7 for(int i = 1; i <= 97; i += 2) 8 sum += (i * 1.0) / ((i + 2) * 1.0); 9 10 System.out.println("sum is " + sum); 11 } 12 }