题目内容 (请给出正确答案)
[主观题]

#i nclude 与#i nclude "file.h"的区

别?

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“#i nclude 与#i nclude "file.h"的…”相关的问题

第1题

#i nclude<file.h> 与#i nclude "file.h"的区

别?

点击查看答案

第2题

#i nclude<file.h> 与#i nclude "file.h"的区

别?

点击查看答案

第3题

下列给定程序中,函数fun()的功能是:对N名学生的学习成绩,按从低到高的顺序找出前m(m≤10)名学生来,并将这些学生数据存放在一个动态分配的连续存储区中,此存储区的首地址作为函数值返回。

请改正程序中的错误,使它能得到正确结果。

注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。

试题程序:

include <conio.h>

include <string.h>

include <stdio.h>

include <alloc.h>

define N 10

typedef struct SS

{

char num[10];

int s;

}STU;

STU *fun(STU a[],int m)

{

STU b[N],*t;

int i, j,k;

/*************found*************/

*t=calloc(m,sizeof(STU));

for(i=0;i<N;i++)

b[i]=a[i];

for(k=0;k<m;k++)

{

/*************found*************/

for(i=j=0;i<N;j++)

if(b[i].s<b[j],s)

j=i;

/*************found*************/

t[k].s=b[j].s;

b[j].s=100;

}

return t;

}

outresult(STU a[],FILE *pf)

{

int i;

for(i=0;i<N;i++)

fprintf(pf,"NO=%S Mark=%d\n",

a[i].num,a[i].S);

fprintf(pf,"\n\n");

}

main()

{

STU a[N]={{“A01”,77},{“A02”,85},

{“A03”,96},{“A04”,65},{“A05”,75},

{“A06”,96},{“A07”,76},{“A08”,63},

{“A09”,69},{“A10”,78}};

STU *porder;

int i,m;

clrscr();

printf(“*****THE RESULT*****\n”);

outresult(a,stdout);

printf(“\nGive the number of the students who have lower score:”);

scanf(“%d”,&m);

while(m>10)

{

printf(“\nGive the number of the students who have lower score:”);

scanf(“%d”,&m);

}

porder=fun(a,m);

printf(“*****THE RESULT*****\n”);

printf(“The low:\n”);

for(i=0;i<m;i++)

printf(“%s %d\n”,porder[i].num,

porder[i].s);

free(porder);

}

点击查看答案

第4题

下列给定程序中,函数fun()的功能是:对N名学生的学习成绩,按从高到低的顺序找出前叫m≤10)名学生来,并将这些学生数据存放在一个动态分配的连续存储区中,此存储区的首地址作为函数值返回。

请改正程序中的错误,使它能得出正确的结果。

注意:不要改动main函数,不得增行或删行,也不得更改程序的结构.

试题程序:

include <conio.h>

include <string.h>

include <stdio.h>

include <alloc.h>

define N 10

typedef struct ss

{char num[10];

int s;

} STU;

STU *fun{STU a[], int m)

{ STU b[N] ,*t;

int i, j,k;

/*************found**************/

*t=calloc (m, slzeof (STU));

for(i=0;i<N;i++) b[i]=a[i];

for(k=0; k<m; k++)

{ for (i=j=0;i<N;i++)

if (b[i].s>b[j].s) j=i;

/*************found**************/

t[k].num=b [j].num;

t[k].s=b[j] s;

b[j].s=0;

}

return t;

}

outresult(STU a[],FILE *pf)

{ int i;

for (i=0; i<N; i++)

fprintf(pf, "No=%s Mark-%d\n ",

a [i] .num, a[i].s);

fprintf(pf, "\n\n ");

}

main ( )

{ STU a[N]={{ "A01 ",81},{ "A02 ",89},

{ "A03 ",66},{ "A04 ",87},{ "A05 ",77},

{ "A06 ",90},{ "A07 ",79},{ "A08 ",61},

{ "A09 ",80},{ "Al0 ",71}};

STU *pOrder;

int i, m;

clrscr ();

printf ("*****THE RESULT***** \n");

outresult (a, stdout);

printf ("\nGive the number of the students

who have better score: ");

scanf ("%d", &m);

while (m>10)

{ printf("lnGive the number of the

students who have better score: ");

scanf ("%d", %m);

pOrder=fun (a,m);

printf("***** THE RESULT*****kn");

printf("The top :\n");

for (i=0; i<m; i++)

printf("%s %d\n",pOrder[i].num,

p0rder [i]. s);

free (pOrder);

}

点击查看答案

第5题

下列给定程序中,函数fun()的功能是:对N名学生的学习成绩,按从高到低的顺序找出前m(m≤10)名学生来,并将这些学生数据存放在一个动态分配的连续存储区中,此存储区的首地址作为函数值返回。

注意:部分源程序给出如下。

请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。

试题程序:

#include<stdio.h>

#include<mallo

C.h>

#include<string.h>

#include<conio.h>

#define N 10

typedef struct ss

{

char num[10];

int order;

}STU;

STU *fun(STU a[], int m)

{

STU b[N],*tt;

int i,j,k;

(1) ;

for(i=0; i<N; i++)

b[i]=a[i];

for (k=0;k<m;k++)

{

for(i=j=0;i<N;i++)

if ( (2) )

j=i;

tt[k]=b[j];

b[j].order=0;

}

return (3) ;

}

outresult(STU a[],FILE *pf)

{

int i;

for(i=0;i<N; i++)

fprintf(pf,"No=%s Mark=%d\n",

a[i].num,a[i].order);

fprintf(pf,"\n\n");

}

main()

{

STU [N]={{"A01",80},{"A02",79},

{"A03",66},{"A04",82},{"A05",87},

{"A06",93},{"A07",78},{"A08",60},

{"A09",85},{"A10",73}};

STU *p_order;

int i,m;

clrscr();

printf("*** The Origial data ***\n");

outresult(a, stdout);

printf("\nGive the numeber of the

students who have better score:");

scanf("%d",&m);

while (m>10)

{

printf("\nGive the number of the

studets who have better score:");

scanf("%d",&m);

}

p_order=fun(a,m);

printf("*** THE RESULT ***\n");

printf("*** The top students ***\n");

for(i=0; i<m; i++)

printf(" %s %d\n",

p_order[i].num,p_order[i].order);

free(p_order);

}

点击查看答案

第6题

阅读以下程序说明和C语言程序,将应填入(n)处的字句写在对应栏内。

【说明】

希赛教育集团公司为发展生产向社会公开招聘M个工种的工作人员,每个工种各有不同的编号(1至M)和计划招聘人数。每位应聘者需申报两个工种,并参加公司组织的考试。公司将按应聘者的成绩从高分至低分的顺序进行排队录取。公司的录取原则是:从高分到低分依次对每位应聘者先按其第一志愿录取;当不能按其第一志愿录取时,便将他的成绩扣去5分后,重新排队,并按其第二志愿考虑录取。

程序为输出各工种实际招聘的应聘人员,每个工种都保留一个录取者的有序队列。录取处理循环直至招聘额满或已对全部应聘者都做了录取处理。

程序中,类型STU包含有应聘者的基本信息:编号、成绩、志愿、排队成绩和录取志愿号。数组rz[]的每个元素对应一个工种,包含有计划招聘人数和已录取的人数。

【程序】

include<stdio.h>

include<malloc.h>

define M 20

define PEMARK 5

typedef struct stu{

int no, total, z[2], sortm, zi;

struct stu *next;

}STU;

struct rzmode{

int Imt, count;

STU *next;

}rz[M];

STU *head=NULL, *over=NULL;

int all

FILE *fp;

char dataf[]="pp07.dat";

print(STU *p){

for(;p!=NULL;p=p->next)

printf("%d(%d)\t",p->no,p->total);

}

insert(STU **p, STU *u){

STU *v, *q;

for(q=*p;q!=NULL;v=q,(1))

if(q->sortm<u->sortm)break;

if(q==*p)(2);

else (3);

U->next=q;

}

main(){

int zn, i, no, total, z1, z2;

STU *p, *v, *q;

fp=fopen(dataf, "r");

if(fp==NULL){

printf("Can't open file %s.\n",dataf);

exit(0);

}

fscanf(fp, "%d",&zn);

for(all=0,i=1;i<=zn;i++){

fscanf(fp,"%d",&rz[i].Imt);

rz[i].count=0;rz[i].next=NULL;

all+=(4);

}

for(;;){

if((fscanf(fp, "%d%d%d%d",&no,&total,&z1,&z2))!=4)

break;

p=(STU*)malloc(sizeof(STU));

p->no=no;

p->total=p->sortm=total;

p->zi=0;p->z[0]=z1;p->z[1]=z2;

(5);

}

fclose(fp);

for(;all && head !=NULL;){

p=head; head=head->next;

if(rz[p->z[p->zi]].count<(6)){

rz[p->z[p->zi]].count++;

insert(&rz[p->z[p->zi]].next,p);

all--;

continue;

}

if(p->zi>=1){

p->next=over;over=p;

continue;

}

p->sortm-=DEMARK; (7);

insed(&head,p);

}

for(i=1;i<=zn;i++){

printf("%d:\n",i);

print(rz[i].next);

printf("\n");

}

printf("over:\n");print(head);

print(over);printf("\n");

}

点击查看答案

第7题

Asp页面中用以包含其它页面的命令是()。

A.return

B.include

C.includefile

D.global

点击查看答案

第8题

有以下程序 #include <stdio.h> main() { FILE*pf, char *s1="China",*s2="Beijing"; pf=fopen("abc.dat","wb+"); fwrite(s2,7,1,pf); rewind(pf); /*文件位置指针回到文件开头*/ fwrite(s1,5,1,pf); fclose(pf); } 以上程序执行后abc.dat文件的内容是______。

A.China

B.Chinang

C.ChinaBeijing

D.BeijingChina

点击查看答案

第9题

有以下程序 #include <stdio.h> main() { FILE*pf, char *s1="China",*s2="Beijing"; pf=fopen("abc.dat","wb+"); fwrite(s2,7,1,pf); rewind(pf); /*文件位置指针回到文件开头*/ fwrite(s1,5,1,pf); fclose(pf); } 以上程序执行后abc.dat文件的内容是______。

A.China

B.Chinang

C.ChinaBeijing

D.BeijingChina

点击查看答案

第10题

以下程序的执行结果是【 】。

include <iostream.h>

include <fstream.h>

include <stdlib.h>

int main()

{

fstream outfile, infile;

outfile.open("D:\\text.dat",ios::out);

if(!outfile)

{

cout<<"text.dat can't open"<<end1

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信