那个哥或姐给能帮我调试一下这个程序,我是怎不出来了呀,不知道是那里出错了,希望大家帮我一下,谢谢
#include "stdio.h"
#define n 10
/* main fuction */
main()
{
int a[n]={21,31,32,41,42,43,51,52,53,54};
int b[n]={0,0,0,0,0,0,0,0,0,0};
int i,j;
int *p,r,s,w,t;
for(i=0;i<n;i++)
{
p=a;
b=a;
for(j=0;j<n;j++)
r=(b)%10;s=((b)/10)%10;
w=a[j]%10;t=(a[j]/10)%10;
if ((r==w)||(s==t)||(a[j]==0)||(r==t)||(s==w))
{
p++;
}
else
{
b[i+1]=a[j];
a[j]=0;
break;
}
}
/* shu chu */
for (i=0;i<n;i++)
{
printf("%2d%4d",i+1,b);
printf("\n");
}
printf("\n");
}
|