#include <stdio.h>
#include <stdlib.h>
void main(){
int l[]={3,2,5,3,4,4,2,1,7,9,2,8,1,8,8,1,9,2,1,9,5,8,0,0},i,j,a,b,c,sum1,sums1,sum2,sums2,sum3,sums3,sum4,sums4,sum5,sums5,q;
for(i=0;i<24;i++){
printf("%4d",l[i]);
if((i+1)%4==0){
printf("\n");
}
}
printf("\nplease input you want show the lines(4):\n");
scanf("%d",&q);
if(q<1||q>7){
printf("input error!");
getchar();
return;
}
q*=4;
for(i=0;i<q;i++){
for(j=i+1;j<q;j++){
sum1=(l[i]+l[j])%10;
sum2=(l[i+4]+l[j+4])%10;
sum3=(l[i+8]+l[j+8])%10;
for(a=i+1;a<q;a++){
for(b=a+1;b<q;b++){
sums1=(l[a]+l[b])%10;
sums2=(l[a+4]+l[b+4])%10;
sums3=(l[a+8]+l[b+8])%10;
if(sum1==sums1&&sum2==sums2&&sum3==sums3){
printf("键值: %2d+%2d=%2d+%2d\n",l[i+8],l[j+8],l[a+8],l[b+8]);
printf("下标: %2d+%2d=%2d+%2d\n",(i+9),(j+9),(a+9),(b+9));
}
}
}
}
}
getchar();
}
q*=4 就是 q=q*4 ,我问的是它在程序里面是什么作用?(就是它的功能是什么?起什么作用啊?)
q = q * 4
q*= 4 ; 是q = q * 4 ;的简写