大家来找错
#include"stdio.h" main() { int x; for(x=21;x!=0;) { scanf("%x",&x); printf("%d %s",x,x); } getch(); }
大家来看看,这个程序到底有多少问题。。。。。。。
#include"stdio.h" main() { int x; for(x=21;x!=0;) { scanf("%x",&x); printf("%d %s",x,x); } getch(); }
大家来看看,这个程序到底有多少问题。。。。。。。
for(x=21;x!=0;)
x不等于0就一直循环下去.他设置拉,怕死循环就打个0然后回车.
不知道我理解对不对
不对,循环的时候重新输入,没问题的。
哦,那是IO先读后读的问题,我在几个帖子都说过,具体找本书看看,例如
《C++ Distilled》,最近才翻译好的,很薄很快就可以看完且易懂,精品啊!