更多"以下程序运行结果是 【10】 。 #include<stdio.h>"的相关试题:
[填空题]以下程序运行结果是 【10】 。
#include<stdio.h>
long fib(int g)
switch(g)
case 0:return 0;
case 1:
case 2:return 1;
return(fib(g-1)+fib(g-2));
main( )
long k;
k=fib(5);
printf("k=%5ld/n",k);
[填空题]以下程序的运行结果是______。
#include<stdio.h>
long fib(int g)
switch(g)
case 0:return 0;
case 1:
case 2:return 1;
return(fib(g-1)+fib(g-2));
main( )
long k;
k=fib(5);
printf("k=%51d/n",k);
[填空题]以下程序的运行结果是 【8】 。
#include <stdio.h>
long fib (int g)
{ switch (g)
{ case 0: return 0;
case 1: case2: return 1;
}
return (fib(g-1)+fib(g-2));
}
main( )
{ long k;
k=fib(5);
printf("k=%d/n",k);
}
[简答题]读出下面程序的运行结果。
#include<stdio.h>
long fib(int n)
if(n>2)
return(fib(n-1)+fib(n-2));
else
return(2);
main( )
printf(“%d/n”,fib(6));
程序的运行结果是:
[填空题]以下程序运行结果是 【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));
[填空题]以下程序的运行结果是______。
#include<stdio.h>
long fib(int g)
{ switch(g)
{ case 0:return 0;
case 1:
case 2:return 1;}
return(fib(g-1)+fib(g-2));}
main( )
{ long k;
k=fib(5);
printf("k=%51d/n",k);}
[填空题]以下程序的运行结果是______。
#include <stdio.h>
long fib(int g)
switch(g)
case 0:return 0;
case 1:
case 2:return 1;
return(fib(g-1) +fib(g-2));
main( )
long k;
k=fib(5);
printf("k=%51d/n",k);
[填空题]阅读下面程序:
#include <iostream.h>
long fib(int n)
if (n>2)
return (fib(n-1)+fib(n-2));
else
return (2);
void main( )
cout<<fib(3)<<endl;
则该程序的输出结果应该是______。
[填空题]以下程序运行时输出到屏幕的结果是【11】 。
#include
long f(int n)
{static long s;
if(n==1) return s=2;
else return ++s;
}
void main( )
{long i,sum=0;
for(i=1;i<4;i++,) sum+=f(i);
printf("%ld",sum);
}
[填空题]阅读下面程序:
#include <iostream.h>
long fib(int n)if (n>2)
return (fib(n-1) + fib(n-2));
else
return (2);void main( )cout<<fib(3)<<end1;则该程序的输出结果应该是 【12】 。
[填空题]以下程序运行后的输出结果是 。
int a=5;
fun(int b)
static int a=10;
a+=b++;
printf("%d",a);
main( )
int c=20;
fun(c);
a+=c++;
printf("%d//n",a);
[填空题]下列程序的运行结果是______。
#include<stdio.h>
long func(int x)
long p;
if(x==0||x==1)
return(1);
p=x*func(x-1);
return(p);main( )
printf("%d/n",func(4));
[单项选择]以下程序运行后的输出结果是
void swap(int x, int y)
int t;
t=x;x=y;y=t;
main( )
int a=15, b=16;
swap(a, b); printf("% d % d", a, b);
A. 15, 16
B. 16, 15
C. 15, 15
D. 16, 16
[填空题]以下程序运行后的输出结果是【 】。
int f(int a[],int n)
{if(n>=1 return f(a,n-1)+a[n-1);
else return 0;
}
main( )
{int aa[5]=(1,2,3,4,5),s;
s=f(aa,5); printf("%d/n",s);
}