作者Donnie ( XD)
看板NTUGIEE_EDA
标题Re: [转录]about ++ operator
时间Sat Jul 2 00:07:54 2005
这些只是好玩而已,别太认真啊!
team work 写这种 code 的人该死...
如果 standard 没写清楚,那结果是由 compiler 决定 :P
※ 引述《gwliao (gwliao)》之铭言:
: 那考考大象好了
: 请在不用电脑的情况下作答,
: 因为这些一run程式就结果就出来了!
: 1.
: int a=5,b=7;
: printf("%d\n", a+++b);
: What is the answer?
: 2.
: unsigned int a;
: int b;
: a=6;
: b=-20;
: if( (a+b)>6 )
: printf("a+b>6\n");
: else if( (a+b)<6 )
: printf("a+b<6\n");
: else
: printf("a==b\n");
: What is the answer?
: 3.
: int a=5;
: printf("%d %d %d %d\n",a++,++a,a++,++a);
: What will be printed?
: 要答案的人, 请自己run程式 :P
: 我只挂第三题, 只能说真阴险.......Orz
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.25.204
1F:推 gwliao:1是standard有定义, 2我记得也是有! 3:我记得没有140.112.230.224 07/02
2F:→ gwliao:写这三种当中任何一种的人要被"阿"到死!140.112.230.224 07/02
3F:→ gwliao:这些是我程式设计时"烤"的题目(不包含三)140.112.230.224 07/02
4F:推 yellowfishie:暗黑程式 XD 140.112.25.218 07/02
5F:推 Donnie:出题老师该被阿吗?... 140.112.25.204 07/02
6F:→ moonshade:大一记盖很喜欢出这种鬼东西 203.203.83.73 07/02
7F:→ moonshade:老师无聊没东西可考... 203.203.83.73 07/02
8F:→ gwliao:还好不是我出的, 不要阿我! :O140.112.230.224 07/02
9F:→ gwliao:这三个是一个印度阿三出的, 用来试试新人140.112.230.224 07/02
10F:→ gwliao:试试新人对语法的了解!......140.112.230.224 07/02