填空题

下面程序的运行结果是 【9】 。 #include <iostream> using namespace std; void fun(int &a, int b=3) { static int i=2; a = a + b + i; i = i + a; } int main() { int x=5, y=2; fun(x, y); cout<<x<<","; fun(x); cout<<x<<end1; return 0; }

【参考答案】

I,BC
<上一题 目录 下一题>
热门 试题

填空题
下面是复数类complex的定义,其中作为友元函数重载的运算符“--”的功能是将参数对象的实部减1,然后返回对该对象的引用。请补充完整。class complex{private:int real;int imag;public:complex(int r=0,int i=0):real(r),imag(i){}void show(){cout<<real<<(imag【11】 ;};complex& operator-- (complex &C) {C.real--;return C;}
填空题
fun()函数的功能是:首先对a所指的N行N列的矩阵,找出各行中的最大的数,再求这N个最大值中的最小的那个数作为函数返回值。请填空完成此程序。#define N 100int fun(int (*A) [N]){int row,col,max,min;for(row=0;row 【7】 )max=a[row][col];if(row==0)min=max;else if( 【8】 )min=max;}return min;}
相关试题
  • 有以下程序:#include <iostream>using...
  • 有以下程序:#include <iostream.h>#...
  • 在下面程序横线处填上适当内容,使程序输出...
  • 有以下程序:#include<iostream>using ...