填空题
下列程序的执行结果为 【11】 。
#inciude<iostream, h>
int f(int i) return + +i;
int g(int &i)return ++i;
void main()
int a, b;
a=b=0;
a+ =f(g(A) );
b+=f(f(B) );
cout<<%= "<<a<<", b="<<(b<<end1;
【参考答案】
a=3,b=2
热门
试题
填空题
下列程序不能通过编译,应该在划线部分填写的语句是 【9】 。#include<iostream. h>#include<stdlib. h>double Fune(int a, int b, char ch) double x; switch(ch) case ’+’: x=double(a) +b; break; case ’--’: x= double(a) --b; break; case ’ ’: x=double(a) * b; break; case ’ ’: if(B) x=double(a) b; else exit(1) break default: exit(1); ______ void main() cout<<Func(32 , 6 ,’--’)<< , ; cout<<Func(32, 6 ,’*’) << , ; cout<<Func(32, 6 ,’ ’) <<end1;