填空题

[程序]
#include
void f(int x,int y)
{
int mid;
if(x
mid=(x+y)/2;
cout<
f(x,mid);
}
}
void main(void)
{
f(1,10);
}
执行以上程序后输出的第一行是 () ,第二行是() ,第三行是 ()。

【参考答案】

5;3;2
<上一题 目录 下一题>
热门 试题

填空题
[程序] #include int fun(char *s) { char *p=s; while(*p) p++; return(p-s); } void main(void) { char s1[]={ China },s2[]={ Apple nPear tCat 0Bye }; cout< cout< } 执行以上程序后输出的第一行是 () ,第二行是 () 。
填空题
[程序] #include int f2(int *a,int b) { *a=*a+b; b=*a+b; cout<< *a= <<*a<< t << b= < return *a+b; } void f1(int a,int &b) { a=a+b;b=a+b; b=f2(&a,b); cout<< a= < } void main(void) { int x=4,y=5; f1(x,y); cout< } 执行以上程序后输出的第一行是(),第二行是(),第三行是()
相关试题
  • 以下程序的功能是;从键盘输入一行字符串,...
  • 以下程序的功能是;实现一个队列的简单管理...
  • 以下程序的功能是;从键盘接收一行字符串,...
  • [程序] #include #include class B...
  • [程序] #include void fun(int *s...