题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-21 20:45:12

[填空题]请补充函数fun( ),函数fun( )的功能是求7的阶乘。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun( )的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
long fun(int n)

if( 【1】 )
return(n*fun( 【2】 );
else if( 【3】 )
return 1;

main( )

int k=7;
printf("%d!=%ld/n", k, fun(k));

更多"请补充函数fun( ),函数fun( )的功能是求7的阶乘。 注意:"的相关试题:

[填空题]请补充函数fun( ),函数fun( )的功能是求7的阶乘。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun( )的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
long fun(int n)

if( 【1】 )
return(n*fun( 【2】 );
else if( 【3】 )
return 1;

main( )

int k=7;
printf("%d!=%ld/n", k, fun(k));

[填空题]请补充fun函数,fun函数的功能是求n的阶乘。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在fun函数的横线上填入所编写的若干表达式或语句
试题程序:
#include<stdio.h>
long fun(int n)

if( (1) )
return(n*fun( (2) ));
return (3)

main( )

printf("10!=%1d/n",fun(10));


[填空题]请补充fun( )函数,该函数的功能是求m的阶乘。不要改动主函数main( )与他函数中的任何内容,仅在fun( )函数的横线上填写所需的若干表达式或语句。
注意:部分源程序如下。
#include<stdio.h>
long fun(int m)

if (1)
return(m*fun (2) );
return (3) ;

main( )

printf("8!=%ld/n",fun(8));

[填空题]请补充fun函数,该函数的功能是:判断一个年份是否为闰年。
例如,1900年不是闰年,2004是闰年。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在fun函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#include<conio.h>
int fun(int n)

int flag=0;
if(n%4==0)
if( (1) )
int year;
printf("Input the year:");
scanf("%d",&year);
if(fun(year))
flag=1;
if( (2) )
flag=1;
return (3)

rnain( )

printf("%d is a leap year./n",year);
else
printf("%d is not a leap year./n",year);


[填空题]请补充函数proc( ),函数proc( )的功能是求7的阶乘。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdio.h>
long proc(int n)

if( (1) )
return(n * proc( (2) );
else if( (3) )
return 1;

void main( )

int k=7;
printf("%d!=%ld/n", k, proc(k));


[填空题]请补充fun函数,该函数的功能是:把字符的ASCII码为奇数的字符从字符串str中删除,结果仍然保存在字符串中,字符串str从键盘输入,其长度作为参数传入fun函数。
例如,输入“abcdef”则输出“bdf”。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在main函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#define N 100
void (1)

int i,j;
(2)
for(i=0;i<n;i++)
char str[N];
printf("please input a string:/n");
gets(str);
while(str[i]!=’/0’)

len++;
if(s[i]%2==0)
s[j++]=s[i];
(3)

main( )

int i=0,len=0;
i++;

fun(str,len);
printf("The result string:/n");
puts(str);


[填空题]请补充fun函数,该函数的功能是:将带头结点的单向链表逆置。即若原链表中从头至尾结点数据域依次为:2、4、6、8、10,逆置后,从头至尾结点数据域依次为:10、8、6、4、2。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的行线上填入所编写的若干表达式或语句。
[试题源程序]
#include<stdio.h>
#include<stdlib.h>
#define N 5
typedef struct node
int data;
struct node * next;
NODE;
void fun(NODE * h)

NODE*P,*q,*r;
p= (1)
if( (2) )return;
q=p->next;
p->next=NULL;
while(q)
r=q->next;
q->next=p;
p=q;
q= (3)

h->next=p;

NODE*creatlist(int a[])

NODE*h.*p,*q;int i;
h=(NODE*)malloc(sizeof(NODE));
h->next=NULL;
for(i=0;i<N;i++)

q=(NODE*)malloc(sizeof(NODE));
q->data=a[i];
q->next=NULL;
if(h->next==NULL)
h->next=p=q;
else

P->next=q;p=q;


return h;

void outlist(NODE*h)

NODE*P;
p=h->next;
if(p==NULL)
printf("The list is NULL!/n");

[填空题]请补充函数fun( ),该函数的功能是:返回字符数组中指定子符的个数,指定字符从键盘输入。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun( )的横线上填入所编写的若干表达式或语句。
试题程序:
#include <stdio.h>
#define N 80
int fun (char s[],char ch)

int i=0, n=0;
while( 【1】 )

if( 【2】 )
n++;
i++;

【3】 ;

main ( )

int n;
char str[N], ch;
clrscr ( );
printf ("/nInput a string: /n");
gets (str);
printf ("/nInput a charactor: /n" ;
scanf ("%c", &ch);
n=fun (str, ch);
printf("/nnumber of %c:%d", ch, n);

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码