public class Test { public static void main(String[] args) { double num=0; for(double i = 1;i<=3;i++){ if(i==1){ num=1; }else if(i%2==0){ num+=(1/i); }else{ num+=(1/i); } } System.out.println(num); }}