演示,不是算法
void m4()
{
int a[4]={1,0,0,1};
int m[15];
int temp;
for(int i=0;i<15;i++){
m[i] = a[0];
printf("%d-%d-%d-%d\n",a[3],a[2],a[1],a[0]);
//temp = (a[0]+a[3])%2;
temp = (a[0]+a[1])%2;
a[0] = a[1];
a[1] = a[2];
a[2] = a[3];
a[3] = temp;
}
for(i=0;i<15;i++){
printf("%d",m[i]);
}
printf("=m4\n");
}
void m5()
{
int a[5]={1,0,0,0,0};
int m[31];
int temp;
for(int i=0;i<31;i++){
m[i] = a[0];
printf("%d-%d-%d-%d-%d\n",a[4],a[3],a[2],a[1],a[0]);
//temp = (a[0]+a[3])%2;
temp = (a[0]+a[2])%2;
a[0] = a[1];
a[1] = a[2];
a[2] = a[3];
a[3] = a[4];
a[4] = temp;
}
for(i=0;i<31;i++){
printf("%d",m[i]);
}
printf("=m5\n");
}
void m8()
{
int a[8]={1,0,0,0,0