有以下程序: #include<iostream.h> Float fun(int x, int y) { return(x+y) ;} void main( ) { int a=2,b=5,c=8; cout <

admin2010-12-16  40

问题 有以下程序:    #include<iostream.h>    Float fun(int x, int y)    {  return(x+y) ;}    void main( )    {  int a=2,b=5,c=8;    cout < < fun((int) fun(a+c, b) ,a-c) ;}    程序运行后的输出结果是

选项 A、编译出错
B、9
C、21
D、9.0

答案B

解析 本题的运算过程是fun((int) fun (a+c, b) ,a-c) ,fun((int) fun(10,5) ,2-8) ,fun ((int) 15.000000,-6) ,fun(15,-6) =9。
转载请注明原文地址:https://jikaoti.com/ti/zyL0FFFM
0

最新回复(0)