牛客16785 Cantor表
先找到第N个数在第几行第几列,然后根据规律进行计算
N = int(input())
t = 1
while N-t > 0:
N = N-t
t += 1
if t%2 == 0:
print("%d/%d"%(N,t-N+1))
else:
print("%d/%d"%(t-N+1,N))
先找到第N个数在第几行第几列,然后根据规律进行计算
N = int(input())
t = 1
while N-t > 0:
N = N-t
t += 1
if t%2 == 0:
print("%d/%d"%(N,t-N+1))
else:
print("%d/%d"%(t-N+1,N))