import java.util.*; import java.lang.*; import java.io.*; class Ideone { public static void main(String args[]) throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(r.readLine()); ff g = new ff(); System.out.println(g.sum(3)); } } class ff { double sum(int b) { double sum = 0; for (int i = 0; i < b; i++) sum += (i + 1) / (i + 2); return sum; } } Given a positive integer n , it is necessary to calculate the sum of n members of the sequence 1/2 + 3/4 + 5/6 + 7/8 + ...
Why is it considered wrong?