void main()
{
int i;//data flag which marks the result of different procession
int j;//composition method flag of some one data(i)
int k;//the datum position in some one composition method
int m;//the bigist integer not biger than i/2
int n;//the depth of drawback
int count;//used in print
int range;//used in print
int num;//your input number
int dj;//refreshing position(destination_j coresponding to j)
// system and data initialise
printf("\ninput a integer:");
scanf("%d",&num);
for(i=0;i<MAXNUM;i++)
{
for(j=0;j<MAXSEQ;j++)
{
for(k=0;k<MYNUM;k++)
{
a[i][j][k]=0;
}
}
}
// special procession of case 1
a[1][0][0]=1;//i:num j:composition sequence k:compositor from big to small
//a[i][j][0]:min compositor
a[1][0][1]=1;
i=2;j=0;k=0;
// begin processing from 2 to num
while(i<=num)
{
n=1;
m=i/2;
dj=0;
//special procession of case num
a[i][dj][0]=i;
a[i][dj][1]=i;
dj++;
// quote the existing sequence that contain min number n
while(n<=m)
{
//special procession of the first existing sequence
//it surely contains 2 data:min_flag and the quoted num(i-n)
//and they are equal
j=0;
k=0;
a[i][dj][0]=a[i-n][j][0];
a[i][dj][1]=a[i-n][j][1];
a[i][dj][2]=n;
a[i][dj][0]=n;
dj++;
j++;
//normal procession : quote and refresh
//auto detect which one can be quoted and refresh the min
while(a[i-n][j][0]!=0)
{
if(n<=a[i-n][j][0])
{
k=0;
while(a[i-n][j][k]!=0)
{
a[i][dj][k]=a[i-n][j][k];
k++;
}
a[i][dj][k]=n;
a[i][dj][0]=n;
dj++;
}
j++;
}
n++;
}
i++;
}