首页 新闻 会员 周边 捐助

请问 q*=4 在下面程序里是什么作用?

0
悬赏园豆:20 [已关闭问题] 关闭于 2014-12-18 12:48

#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 ,我问的是它在程序里面是什么作用?(就是它的功能是什么?起什么作用啊?)

年年十八的主页 年年十八 | 初学一级 | 园豆:3
提问于:2014-12-10 11:53
< >
分享
所有回答(2)
0

q = q * 4 

幻天芒 | 园豆:37205 (高人七级) | 2014-12-10 12:18
0

q*= 4 ; 是q = q * 4 ;的简写

学_无_止_境 | 园豆:217 (菜鸟二级) | 2014-12-10 19:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册