棘手的输出??? [英] tricky output ???

查看:81
本文介绍了棘手的输出???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include< stdio.h>

int main(void){

int i = 5;

printf("%) d%d%d%d%d \ n",i ++,i - ,++ i, - i,i);

返回0;

}

这给了我:4 5 5 5 5


如何???


任何人都可以请给我有些暗示我为什么会这样做?


谢谢&问候,

Onkar

#include<stdio.h>
int main(void){
int i=5;
printf("%d %d %d %d %d\n",i++,i--,++i,--i,i);
return 0;
}
This gives me : 4 5 5 5 5

How ???

Can anyone please give me some hint as to why I am getting this ??

Thanks & regards,
Onkar

推荐答案

onkar说:
onkar said:

#include< stdio.h>

int main(void){

int i = 5;

printf(" ;%d%d%d%d%d \ n",i ++,i - ,++ i, - i,i);

返回0;

}


这给了我:4 5 5 5 5


如何???


任何人都可以给我一些提示,为什么我得到这个?
#include<stdio.h>
int main(void){
int i=5;
printf("%d %d %d %d %d\n",i++,i--,++i,--i,i);
return 0;
}
This gives me : 4 5 5 5 5

How ???

Can anyone please give me some hint as to why I am getting this ??



你期待什么答案,为什么?

-

Richard Heathfield< http:/ /www.cpax.org.uk>

电子邮件:-http:// www。 + rjh @

谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>

Usenet是一个奇怪的放置" - dmr 1999年7月29日

What answer were you expecting, and why?
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999


2月16日上午11:17,Richard Heathfield< r ... @ see.sig.invalidwrote:
On Feb 16, 11:17 am, Richard Heathfield <r...@see.sig.invalidwrote:

onkar说:
onkar said:

#include< stdio.h>

int main(void){

int i = 5;

printf("%d%d%d%d%d \ n,i ++,i - ,++ i, --i,i);

返回0;

}
#include<stdio.h>
int main(void){
int i=5;
printf("%d %d %d %d %d\n",i++,i--,++i,--i,i);
return 0;
}


这给了我:4 5 5 5 5
This gives me : 4 5 5 5 5


如何???
How ???


任何人都可以给我一些提示,说明为什么我会这样做?
Can anyone please give me some hint as to why I am getting this ??



你期待什么答案,为什么?


-

Richard Heathfield< ; http://www.cpax.org.uk>

电子邮件:-http:// www。 + rjh @

谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>

Usenet是一个奇怪的放置" - dmr 1999年7月29日


What answer were you expecting, and why?

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999



我期待4 5 5 4 5


I was expecting 4 5 5 4 5


onkar< on ** *****@gmail.com写:
onkar <on*******@gmail.comwrites:

#include< stdio.h>

int main(void){

int i = 5;

printf("%d%d%d%d%d \ n",i ++,i - ,++ i, - i ,i);

返回0;

}


这给了我:4 5 5 5 5
#include<stdio.h>
int main(void){
int i=5;
printf("%d %d %d %d %d\n",i++,i--,++i,--i,i);
return 0;
}
This gives me : 4 5 5 5 5



[...]


此新闻组的常见问题解答位于< http://www.c-faq.com/> ;。


你迫切需要阅读第3节。(然后阅读剩下的部分。)


-

Keith Thompson(The_Other_Keith)< ks *** @ mib.org>

诺基亚

我们必须做点什么。这是事情。因此,我们必须这样做。

- Antony Jay和Jonathan Lynn,是部长

[...]

The FAQ for this newsgroup is at <http://www.c-faq.com/>.

You desperately need to read section 3. (Then read the rest of it.)

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


这篇关于棘手的输出???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆