
이게 자바야 c야.. 체계적이지 못한 사람이라 그냥 주먹구구로 풀엇습니다 sry
package 기본수학1;
import java.util.Scanner;
public class Num1193 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
int group = 0;
int res = 0;
int i = 0;
int bottom = 1;
int top = 1;
while (true) {
if (num <= res) {
break;
}
group++;
res += group;
}
i = num - (res - group);
if (group % 2 == 1) {
top = group;
for (int j = 1; j < i; j++) {
top--;
bottom++;
}
} else {
bottom = group;
for (int j = 1; j < i; j++) {
bottom--;
top++;
}
}
System.out.println(top + "/" + bottom);
}
}

무한루프 없애고싶다 벅벅
역시.... 분수를 아시는 분..