填空题 C++
题号 #2656966

下列程序的输出结果分别为 (1) 和 (2) 。
(1) #include<iostream.h>
int a,b;
void f(int j){
static int i=a;
int m,n;
m=i+j;  i++;  j++;  n=i*j;  a++;
cout<<”i=”<<i<<’\t’<<”j=”<<j<<’\t’;
cout<<”m=”<<m<<’\t’<<”n=”<<n<<endl;
}
void main(){
a=1; b=2;
f(b);  f(a);
cout<<”a=”<<a<<’\t’<<”b=”<<b<<endl;
}

进入在线模考

参考答案

暂无

答案解析

(1)i=2  j=3  m=3  n=6
i=3  j=3  m=4  n=9
a=3  b=2

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考