28�屎���太���
����写��冉峡�����一些�,��要������薪�突���要��同��时��
#include<stdio.h>
const N=28;
int a[100];
int sum;
void search(int n,int deep)
{
    int j;
    for(j=1;j<deep;j++)
    {
        if((n-a[j]==deep-j)||(n-a[j]==j-deep)||n==a[j])return;
    }
    a[deep]=n;
    if(deep==N)
    {
        for(int i=1;i<N;i++)
            printf("%d ",a[i]);
        printf("\n");
    }
    else
    {
        int f=(n+1)%N+1;
        for(j=f;j<=N;j++)
        {
            search(j,deep+1);
        }
        for(j=1;j<f;j++)
        {
            search(j,deep+1);
        }
    }
}
main()
{
    search(0,0);
    printf("%d",sum);
}


�� �� JediKnight (01CS~~�����士) �拇������到: ��
: ���芨芯����不�诔��颉�
: �� �� zyypppII (finallypoor�����2.0��) �拇������到: ��
: : ����只要�贸�一������邪桑��蔷�要�酶����法


--
谁�冶��掖�����
�� ��源:���野��峡�站 bbs.nankai.edu.cn��[FROM: 10.10.106.38]