http://noi.openjudge.cn/ch0108/02/
""" NOIP1996复赛 普及组 第二题 python 1.8编程基础之多维数组 02 同行列对角线的格子 http://noi.openjudge.cn/ch0108/02/ """ n,x,y=map(int,input().split()) for i in range(1,n+1): print("(%d," %x,end='') print("%d)" %i,end=' ') print() #print("n") for i in range(1,n+1): print("(%d," %i,end='') print("%d)" %y,end=' ') print() #print("n") for i in range(1,n+1): for j in range(1,n+1): if (i-j)==(x-y): print("(%d," %i,end='') print("%d)" %j,end=' ') print() #print("n") for i in range(1,n+1): for j in range(1,n+1): if (i+j)==(x+y): print("(%d," %j,end='') print("%d)" %i,end=' ') print() #print("n")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)