Scanner in = new Scanner(System.
in)
System.out.print("masukkan input :")
int input = in.nextInt()
int lipat = 1
String output = "1"
int i = 2
i <= input
True False
String temp = Integer.toString(i) System.out.println("output : " + output)
i % 3 == 1 || i % 3 == 2
True False
int j = 1 i % 3 == 0
True
int j = 1
j < lipat
False True
lipat > 1 False j < lipat
temp= '('+temp+')' True False True
False temp = temp + "x" + Integer.toString(i) temp = "(1/" + temp + ')' lipat > 1
True
j++ lipat++ False temp = temp + "x" + Integer.toString(i)
output = output + "+" + temp j++
i++