填空题

阅读下面程序:
#include <iostream.h>
int fun( int a, int b )int c;
c=a*b;
return c;void main()int a=3,b=5,c=4,x=0;
x=fun(fun(a, b),c);
cout<<x<<end1;其运行结果是 【9】 。

【参考答案】

60
<上一题 目录 下一题>
热门 试题

填空题
在下面的程序的横线处填上适当的语句,使该程序的输出为12。#include <iostream>using namespace std;class Basepublic: int a,b; Base(int i) a=i; ;class Derived: public Base int a;public: Derived(int x): Base(x),b(x+1) void show() 【13】 ; 输出基烃数据成员a的值。 cout<<b<<end1;;int main() Derived d(1); D. show(); return 0;
填空题
阅读下面程序:#include <iostream.h>long fib(int n)if (n>2)return (fib(n-1) + fib(n-2));elsereturn (2);void main()cout<<fib(3)<<end1;则该程序的输出结果应该是 【12】 。
相关试题
  • 请将下列类定义补充完整。class Base pub...
  • 【14】 允许用户为类定义一种模式,使得...
  • 以下程序的执行结果是 【11】 。#incl...