十年没编程,今天编一个发觉不行了,大家帮我找找这个程序的毛病
#include "stdio.h"void main()
{ printf("input\n");
static int a[20][3],b[20][3];
static int i,j;
for(i=0;i<20;i++)
{printf("\n");
for(j=0;j<3;j++)
{scanf("%d",a[i][j]);
}
}
for (i=0;i<20;i++)
{ for(j=0;j<3;j++)
{b[i][j]=a[i][j]%5;
}
}
char c[19][3];
for(i=0;i<19;i++)
{for(j=0;j<3;j++)
{if((b[i][j]==0)&&(b[i+1][j]==0))c[i][j]='t';
else if((b[i][j]==0)&&(b[i+1][j]==(1||3)))c[i][j]='k';
else if((b[i][j]==0)&&(b[i+1][j]==(2||4)))c[i][j]='s';
else if((b[i][j]==1)&&(b[i+1][j]==1))c[i][j]='t';
else if((b[i][j]==1)&&(b[i+1][j]==(2||0)))c[i][j]='k';
else if((b[i][j]==1)&&(b[i+1][j]==(3||4)))c[i][j]='s';
else if((b[i][j]==2)&&(b[i+1][j]==2))c[i][j]='t';
else if((b[i][j]==2)&&(b[i+1][j]==(4||1)))c[i][j]='k';
else if((b[i][j]==2)&&(b[i+1][j]==(0||3)))c[i][j]='s';
else if((b[i][j]==3)&&(b[i+1][j]==3))c[i][j]='t';
else if((b[i][j]==3)&&(b[i+1][j]==(0||4)))c[i][j]='k';
else if((b[i][j]==3)&&(b[i+1][j]==(2||1)))c[i][j]='s';
else if((b[i][j]==4)&&(b[i+1][j]==4))c[i][j]='t';
else if((b[i][j]==4)&&(b[i+1][j]==(2||3)))c[i][j]='k';
else c[i][j]='s';
}
}
for(i=0;i<19;i++)
{printf("\n");
for(j=0;j<3;j++)
{printf("%c",c[i][j]);
}
}
}