更多"以下程序的运行结果是 【8】 。 #include <stdio.h"的相关试题:
[填空题]以下程序的运行结果是 【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 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);
[填空题]以下程序运行结果是 【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 n)
if(n>2)
return(fib(n-1)+fib(n-2));
else
return(2);
main( )
printf(“%d/n”,fib(6));
程序的运行结果是:
[填空题]以下程序的运行结果是______。
#include<stdio.h>
long fb(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;
则该程序的输出结果应该是______。
[单项选择]以下程序的输出结果是
#include<iostream.h>
long fun(int n)
long s;
if(n=1||n=2)s=2;
else s=n-fun(n-1);
return s;
void main( )
cout<<fun(3);
A. 1
B. 2
C. 3
D. 4
[填空题]下列程序的运行结果是()。
#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));
[填空题]下列程序的运行结果是______。
#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));
[填空题]下列程序的运行结果是______。
#include<stdio.h>
long func(int x)
long p;
if(x==O‖x==1)
return(1);
p=x*func(x-1);
return(p);
main( )
printf("%d/n",func(4));
[填空题]下列程序的运行结果是______。
#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));
[单项选择]以下C程序段的输出结果是 (35) 。
#include<stdio.h)
long fun(int n)
long s;
if(n==1 || n==2)
s=2;
else
s=n+fun(n-1);
return s;
void main( )
printf("/n%1d",fun(4)); )
A. 5
B. 7
C. 9
D. 11
[填空题]以下程序运行后的输出结果是【 】。
struct NODE
{int num;struct NODE *next;
};
main( )
{struct NODE s[3]={{1,’’/0’’},{2,’’/0’’},{3,’’0’’}},*p,*q,*r;
int sum=0;
s[0].next=s+1;s[1].next=s+2;s[2].next=s;
p=s; q=p->next; r=q->next;
sum+=q->next->num; sum+=r->next->next->num;
printf("%d/n",sum);
}