设有以下宏定义:#defineA20#defineBA+30则执行赋值语句v=B*2;后,假设v为整型,则v的值为
查看答案
设有如下宏定义:#define MYSWAP(z,x,y) {z=x;x=y;y=z;),以下程序段通过宏调用实现变量a、b内容交换,请填空.f1oata=5,b=16,c;MYSWAP( ____,a,b);
写出结果#defineSSSV(s1,s2,s3,v)s1=l*w;s2=l*h;s3=w*h;v=w*l*h;main(){int1=3,w=4,h=5,sa,sb,sc,vv;SSSV(sa,sb,sc,vv);printf("sa=%d\nsb=%d\nsc=%d\nvv=%d\n",sa,sb,sc,vv);}
写出结果#include#defineBOT (-2)#defineTOP (BOT+5)#definePRI(arg)printf("%d\n",arg)#defineFOR(arg)for(;(arg);(arg)--)main(){inti=BOT,j=TOP;FOR(j)switch(j){case1:PRI(i++);case2:PRI(j);break;default:PRI(i);}}
写出显示结果#defineNUMokmain(){structstu{intnum;char*name;charsex;floatscore;}*ps;ps=(structstu*)malloc(sizeof(structstu));ps->num=102;ps->name="Zhangping";ps->sex="M';ps->score=62.5;#ifdefNUMprintf("Number=%d\nScore=%f\n",ps->num,ps->score);#elseprintf("Name=%s\nSex=%c\n",ps->name,ps->sex);#endiffree(ps);}