Scanner in = new Scanner(System.
in)
[Link]("masukkan input :")
int input = [Link]()
int lipat = 1
String output = "1"
int i = 2
i <= input
True False
String temp = [Link](i) [Link]("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" + [Link](i) temp = "(1/" + temp + ')' lipat > 1
True
j++ lipat++ False temp = temp + "x" + [Link](i)
output = output + "+" + temp j++
i++