P1014 [NOIP1999 普及组] Cantor 表
import java.util.Scanner;
import java.util.Scanner;
public class hello {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a = in.nextInt();
int i;
int b;
int c;
String str = "/";
if (a == 1) {
System.out.println(1 + str + 1);
} else {
for (i = 1; i <= 1000000; i++) {
if ((i * (i + 1)) / 2 < a && ((i + 1) * (i + 2)) / 2 > a) {
b = a - (i * (i + 1)) / 2;
c = i + 2 - b;
System.out.println(b + str + c);
break;
} else if (a == (i + 1) * (i + 2) / 2) {
System.out.println(i + 1 + str + 1);
break;
}
}
}
}
}