A-A+

以下程序运行后的输出结果是【 】。 include <stdio h> main() {

2022-08-12 18:53:27 问答库 阅读 197 次

问题详情

以下程序运行后的输出结果是【 】。 include <stdio, h> main() { int a=3,b=4,c=5,t=99; if(b<a && a<c) t=a;a=c;c=t; if(a<e && b<c) t=b;b=a;a=t; printf("%d %d %d n" ,a,b,e); }


请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:4599
要注意每条证语句后面是三条语句,而不是一条语句。执行第一条if语句时,条件表达式不成立,执行a=c;c=t;,此时a=5,c=99;执行第二条if语句时,条件表达式成立,执行t=b;b=a;a=t;交换a,b的值,输出结果为4,5和99。

考点:程序