利用循环链表打印拉丁方阵
拉丁方阵就是一个n×n(2≤n≤9)的方阵,每个格子里存放一个数字,要求每一横行每一纵行数字不重复。例如:
1 2
2 1
n要求由用户输入
C语言实现代码:
#include <stdio.h>
#include <stdlib.h>
typedef struct LD{
int id;
struct LD* next;
}LA;
LA* newlist(int);
void print(LA*,int);
int main()
{
int n = 0;
while(1)
{