有如下一组数字,其中每个数字都在 1 ~ 63 之间, 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37
1个回答
展开全部
#include<stdio.h>
main()
{
int s[6][32]={1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31,34,35,38,39,42,43,46,47,50,51,54,55,58,59,62,63,4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31,36,37,38,39,44,45,46,47,52,53,54,55,60,61,62,63,8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31,40,41,42,43,44,45,46,47,56,57,58,59,60,61,62,63,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
int a,b,c,i,j,k,l,h,k1,k2;
static int t[32];
scanf("%d%d%d",&a,&b,&c);
for(k=0,i=0;i<32;i++)
for(j=0;j<32;j++)
if(s[a-1][i]==s[b-1][j])
{t[k]=s[a-1][i];
k++;
}
m: for(k2=k,l=0;l<6;l++)
{
if(l==a-1||l==b-1)
continue;
for(h=0,k2--;h<32&&k2>0&&t[k2]!=0;h++,k2--)
if(t[0]==s[l][h])
{
for(k1=0;k1<=k2;k1++)
t[k1]=t[k1+1];
goto m;
}
}
printf("%d\n",t[0]);
}
main()
{
int s[6][32]={1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31,34,35,38,39,42,43,46,47,50,51,54,55,58,59,62,63,4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31,36,37,38,39,44,45,46,47,52,53,54,55,60,61,62,63,8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31,40,41,42,43,44,45,46,47,56,57,58,59,60,61,62,63,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
int a,b,c,i,j,k,l,h,k1,k2;
static int t[32];
scanf("%d%d%d",&a,&b,&c);
for(k=0,i=0;i<32;i++)
for(j=0;j<32;j++)
if(s[a-1][i]==s[b-1][j])
{t[k]=s[a-1][i];
k++;
}
m: for(k2=k,l=0;l<6;l++)
{
if(l==a-1||l==b-1)
continue;
for(h=0,k2--;h<32&&k2>0&&t[k2]!=0;h++,k2--)
if(t[0]==s[l][h])
{
for(k1=0;k1<=k2;k1++)
t[k1]=t[k1+1];
goto m;
}
}
printf("%d\n",t[0]);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |