更多"下列程序的输出结果为 #include<iostream.h> i"的相关试题:
[单项选择]下列程序的输出结果为
#include<iostream.h>
int func(int n)
if(n<1) return 1;
else retur n+func(n-1) ;
return 0;
void main( )
cout < < func(5) < < endl;
A) 0 B) 10 C) 15 D) 16
[填空题]下列程序的运行结果是 【9】 。
#include<iomanip. h>
int Func(int * a, int n) int s=1;
for(int i=0;i<n; i++)
s*= * a++;
return s;void main( ) int a[]=1,2,3,4,5,6,7,8);
int b=Func(a,6)+Fnnc(& a [5],2);
cout<<"b= "<<b<<end1;
[填空题]以下程序运行结果是 【12】 。
#include<stdio.h>
long func(int x)
long p;
if(x==0‖x==1)return(2);
p=x*func(x-1);
return(p);
main( )
printf("%d/n",func(4));
[填空题]以下程序的运行结果是 【12】 。
#include<iostream.h>
func(int a,int b)
statlC int m=0,i=2;
i+=m+1;
m=i+a+b;
return m;
void main( )
int k=4,m=1,p;
p=func(k,m);cout<<p<<”,”;
p=func(k,m);cout<<p<<endl;
[单项选择]有如下程序
#include<iostream.h>
int func(int a,int b)
return(a+b) ;
void main( )
int x=2,y=5,z=8, r;
r=func ( func(x,y),z);
cout << r;
该程序的输出的结果是
A. 12
B. 13
C. 14
D. 15
[单项选择]以下程序的输出结果是( )。
#include<iostream.h>
void func(char**m)
++m:
cout<<*m<<end1;
void main( )
static char*a[]="MORNING","AFTERTOON","EVENING";
char**n:
n=a;
func(n);
A. 为空
B. MORNING
C. AFTERTOON
D. EVENING
[填空题]下列程序的输出结果为 【12】 。
# include <iostream, h>
void Func(char ch) switch (ch).
case ’A’: case ’a’
cout<<"优秀"<<end1;
case ’B’: case ’b’:
cout<<"良好"<<end1;
break;
case ’C’: case ’c’:
cout<<"及格" <<end1
break;
default
cout<<"不及格"<<end1;
void main( ) char ch1 =’b’
Fune(chl);
Func(’A’);
[单项选择]请读程序:
#include<stdio.h>
func(int a,int b)
int c;
c=a+b;
return c;
main( )
int x=6,y=7,z=8,r,
r=func((x-,y++,x+y),z-);
printf("%d/n",r);
上面程序的输出结果是_______。
A. 11
B. 20
C. 21
D. 31
[单项选择]请读程序:
#include <stdio.h>
func(int a, int b)
int c;
c=a+b;
return c;
main( )
int x=6,y=7,z=8,r;
r=func((x--,y++,x+y),z--);
printf("%d/n",r);
上面程序的输出结果是( )。
A. 11
B. 20
C. 21
D. 31
[填空题]下列程序的输出结果为______。
#include<iostream.h>
void Func(char ch)
switch(ch)
case ’A’:case ’a’:
cout<<"优秀"<<endl;
case ’B’:case ’b’:
cout<<"良好"<<endl;
break;
case ’C’:case ’c’:
cout<<"及格"<<endl;
break;
default:
cout<<"不及格"<<endl;
void main( )
char ch1=’b’
Func(ch1);
Func(’A’);