public class Sample3 { public static void main(String[] args) { int j = 0; for (int i = 1; i <= 500; i++) { j = j + 1 / i; } System.out.println("この計算結果は" + j + "です"); } }