题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-03-01 04:31:14

[单项选择]对某一给定的程序,具有最高命中率的Cache替换算法是( )。
A. 先进先出替换算法
B. 最近最少使用替换算法
C. 随机替换算法
D. 无法确定

更多"对某一给定的程序,具有最高命中率的Cache替换算法是( )。"的相关试题:

[单项选择]在Cache的淘汰算法中,平均命中率最高的算法是______。
A. FILO
B. FIFO
C. 随机淘汰
D. LRU
[单项选择]某计算机主存的读/写时间为100ns,其Cache的读/写时间为10ns,Cache的命中率为90%,那么每条指令的访存时间是______。
A. 15ns
B. 19ns
C. 16ns
D. 32ns
[多项选择]参考标准是在给定地区或给定组织内,通常具有最高计量学特性的一种测量标准。在我国,与参考标准相当的是( )。
A. 某地区的社会公用测量标准
B. 事业单位的最高测量标准
C. 工作标准
D. 企业单位的最高测量标准
E. 某部门的最高测量标准
[简答题]给定程序中,函数fun的功能是将形参给定的字符串、整数、浮点数写到文本 文件中,再用字符方式从此文本文件中逐个读入并显示在终端屏幕上。 请在程序的下划线处填入正确的内容并把下划线删除, 使程序得出正确的结果。 注意:源程序存放在考生文件夹下的BLANK1.C中。 不得增行或删行,也不得更改程序的结构! 给定源程序: #include void fun(char *s, int a, double f) { __1__ fp; char ch; fp = fopen("file1.txt", "w"); fprintf(fp, "%s %d %f/n", s, a, f); fclose(fp); fp = fopen("file1.txt", "r"); printf("/nThe result :/n/n"); ch = fgetc(fp); while (!feof(__2__)) { putchar(__3__); ch = fgetc(fp); } putchar(’/n’); fclose(fp); } main( ) { char a[10]="Hello!"; int b=12345; double c= 98.76; fun(a,b,c); }
[简答题]给定程序中,函数fun的功能是将参数给定的字符串、整数、浮点数写到文本 文件中,再用字符串方式从此文本文件中逐个读入,并调用库函数atoi和atof将字符串转换成相应的整数、浮点数,然后将其显示在屏幕上。请在程序的下划线处填入正确的内容并把下划线删除, 使程序得出正确的结果。 注意:源程序存放在考生文件夹下的BLANK1.C中。不得增行或删行,也不得更改程序的结构! 给定源程序: #include #include void fun(char *s, int a, double f) { __1__ fp; char str[100], str1[100], str2[100]; int a1; double f1; fp = fopen("file1.txt", "w"); fprintf(fp, "%s %d %f/n", s, a, f); __2__ ; fp = fopen("file1.txt", "r"); fscanf(__3__,"%s%s%s", str, str1, str2); fclose(fp); a1 = atoi(str1); f1 = atof(str2); printf("/nThe result :/n/n%s %d %f/n", str, a1, f1); } main( ) { char a[10]="Hello!"; int b=12345; double c= 98.76; fun(a,b,c); }
[简答题]给定程序中,函数fun的功能是根据形参i的值返回某个函数的值。当调用正确时, 程序输出: x1=5.000000, x2=3.000000, x1*x1+x1*x2=40.000000 请在程序的下划线处填入正确的内容并把下划线删除, 使程序得出正确的结果。 注意:源程序存放在考生文件夹下的BLANK1.C中。不得增行或删行,也不得更改程序的结构! 给定源程序: #include double f1(double x) { return x*x; } double f2(double x, double y) { return x*y; } __1__ fun(int i, double x, double y) { if (i==1) return __2__(x); else return __3__(x, y); } main( ) { double x1=5, x2=3, r; r = fun(1, x1, x2); r += fun(2, x1, x2); printf("/nx1=%f, x2=%f, x1*x1+x1*x2=%f/n/n",x1, x2, r); }
[简答题]给定程序MODI1.C中函数fun的功能是:求k!(k<13),所求阶乘的值作为函数值返回。例如:若k = 10,则应输出:3628800。 请改正程序中的错误,使它能得出正确的结果。 注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构! 给定源程序: #include long fun ( int k) { if k > 0 return (k*fun(k-1)); else if ( k=0 ) return 1L; } main( ) { int k = 10 ; printf("%d!=%ld/n", k, fun ( k )) ; }
[简答题]

给定程序MODI1.C中的函数Creatlink的功能是创建带头结点的单向链表, 并为各结点数据域赋0到m-1的值。
请改正函数Creatlink中指定部位的错误, 使它能得出正确的结果。
注意: 不要改动main函数, 不得增行或删行, 也不得更改程序的结构!
给定源程序:
#include
#include
typedef struct aa
{ int data;
struct aa *next;
} NODE;
NODE *Creatlink(int n, int m)
{ NODE *h=NULL, *p, *s;
int i;
p=(NODE )malloc(sizeof(NODE));
h=p;
p->next=NULL;
for(i=1; i<=n; i++)
{ s=(NODE *)malloc(sizeof(NODE));
s->data=rand( )%m; s->next=p->next;
p->next=s; p=p->next;
}
return p;
}
outlink(NODE *h)
{ NODE *p;
p=h->next;
printf("/n/nTHE LIST :/n/n HEAD ");
while(p)
{ printf("->%d ",p->data);
p=p->next;
}
printf("/n");
}
main( )
{ NODE *head;
head=Creatlink(8,22);
outlink(head);
}


[简答题]下列给定程序中函数fun的功能是:统计substr所指的字符串在str所指的字符串中出现的次数。 例如,若字符串为aass 1kaaas,子字符串为as,则应输出2。 请改正程序中的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构! 试题程序: #include <stdio.h> int fun(char *str, char *substr) { int i, j, k, num=0; /********** found**********/ for(i=0, str[i], i++) for(j=i, k=0; substr[k]==str[j]; k++, j++) /********** found**********/ If(substr[k+1]==’/0’) { num++; break; } return num; } main( ) { char str[80], substr[80]; printf("Input a string:"); gets(str); printf("Input a substfing: "); gets(substr); printf("%d/n", fun(str, substr)); }
[填空题]给定程序中已建立一个带有头结点的单向链表,在main函数中将多次调用fun函数,每调用一次fun函数,输出链表尾部结点中的数据,并释放该结点,使链表缩短。
[注意] 部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。
[试题源程序]
#include<stdio.h>
#include<stdlib.h>
#define N 8
typedef struct list

int data;
struct list *next;
SLIST;
void fun(SLIST *p)

SLIST *t, *s;
t=P->next;
s=p;
while(t->next!=NULL)

s=t;
/*********found**********/
t=t-> (1) ;

/**********found**********/
printf(”%d”, (2) );
s->next=NULL:
/**********found**********/
free( (3) );

SLIST *creatlist(int *a)

SLIST *h, *p, *q;
int i;
h=p=(SLIST *)malloc(sizeof(SLIST));
for(i=0; i<N; i++)

q=(SLIST *)malloc(sizeof(SLIST));
q->data=a[i];
p->next=q;
p=q;

P->next=0;
return h;

void outlist(SLIST *h)

SLIST *p;
p=h->next;
if(
[填空题]下列给定程序中函数fun( )的功能是:计算n!。例如,给 n输入5,则输出120.000000。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include <stdio.h>
#include <conio.h>
double fun (int n)
double result=l.0;
/*************found**************/
if n==0
return 1.0;
while (n>l&&n<170)
/*************found**************/
result *=n--
return result;

main ( )
int n;
printf ("Input N: ");
scanf ( "%d" &n);
printf ("/n/n%d!=%lf/n/n",n, fun(n));

[简答题]

给定程序MODI1.C中fun函数的功能是: 根据整型形参m,计算如下公式的值。
1 1 1
t = 1 - ----- - ----- - …… - -----
2 3 m
例如,若主函数中输入5,则应输出 -0.283333。
请改正函数fun中的错误或在横线处填上适当的内容并把横线删除, 使它能计算出正确的结果。
注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构!
给定源程序:
#include
double fun( int m )
{
double t = 1.0;
int i;
for( i = 2; i <= m; i++ )
t = 1.0-1 /i;
_______;
}
main( )
{
int m ;
printf( "/nPlease enter 1 integer numbers:/n" );
scanf( "%d", &m);
printf( "/n/nThe result is %lf/n", fun( m ) );
}


[简答题]给定程序MODI1.C中函数 fun 的功能是:计算n!。 例如,给n输入5,则输出120.000000。 请改正程序中的错误,使程序能输出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构! 给定源程序: #include double fun ( int n ) { double result = 1.0 ; if n = = 0 return 1.0 ; while( n >1 && n < 170 ) result *= n-- return result ; } main ( ) { int n ; printf("Input N:") ; scanf("%d", &n) ; printf("/n/n%d! =%lf/n/n", n, fun(n)) ; }
[简答题]下列给定程序中,函数fun( )的功能是计算并输出high以内的素数之和。high由主函数传给fun( )函数。
例如:若high的值为100,则函数的返回值为1060。
请改正程序中的错误,使它能得到正确结果。
[注意] 不要改动main函数,不得增行或删行,也不得更改程序的结构。
[试题源程序]
#include <conio.h>
#include <stdio.h>
#include<math.h>
int fun(int high)

int sum=0, n=0, j, yes;
while(high>=2)

yes=1;
for(j=2;j<=high/2; j++)
**********************found**********************/
ifhigh%j==0

yes=0;
break;

/**********************found**********************/
if(yes==0)

sum+=high;
n++;

high--;

return sum;

main( )

clrscr( );
printf("%d/n", fun(100));

[单项选择]当将某一应用程序窗口最大化后,其他已经打开的应用程序窗口的状态是
A. 运行
B. 停止
C. 等待
D. 退出
E. 不一定
[简答题]

下列给定程序是建立一个带头结点的单向链表,并用随机函数为各结点赋值。函数fun( )的功能是:将单向链表结点(不包括头结点)数据域为偶数的值累加起来,并作为函数值返回。
其累加和通过函数值返回main( )函数。例如,若n=5,则应输出8.391667。
请改正程序中的错误,使它能得到正确结果。
[注意] 不要改动main函数,不得增行或删行,也不得更改程序的结构。
[试题源程序]
#include<stdio.h>
#include<stdiib.h>
typedef struct aa

int data;
struct aa *next;
NODE;
int fun(NODE *h)

int sum=0;
NODE *P;
/**********found**********/
p=h;
while(P->next)

if(p->data%2==0)
sum+=p->data;
/**********found**********/
p=h->next;

return sum;

NODE *creatlink(int n)

NODE *h, *p, *s, *q;
int i, x;
h=p=(NODE *)malloc(si zeof(NODE));
for(i=1; i<=n; i++)

s=(NODE *)malloc(sizeof(NODE));
s->data=rand( )%16;
s->next=p->next;
p->next=s;
p=p->next;

p->next=NULL;
return h;

outlink(NODE *h, FILE *Pf)


[简答题]给定程序MODI1.C中函数fun的功能是: 依次取出字符串中所有数字字符, 形成新的字符串, 并取代原字符串。 请改正函数fun中指定部位的错误, 使它能得出正确的结果。 注意: 不要改动main函数, 不得增行或删行, 也不得更改程序的结构! 给定源程序: #include void fun(char *s) { int i,j; for(i=0,j=0; s[i]!=’/0’; i++) if(s[i]>=’0’ && s[i]<=’9’) s[j]=s[i]; s[j]="/0"; } main( ) { char item[80]; printf("/nEnter a string : ");gets(item); printf("/n/nThe string is : /"%s/"/n",item); fun(item); printf("/n/nThe string of changing is : /"%s/"/n",item ); }
[简答题]下列给定程序中,是建立一个带头结点的单向链表,并用随机函数为各结点数据域赋值。函数fun的作用是求出单向链表结点(不包括头结点)数据域中的最大值,并且作为函数值返回。
请改正程序指定部位的错误,使它能得到正确结果。
[注意] 不要改动main函数,不得增行或删行,也不得更改程序的结构。
[试题源程序]
#include<stdio.h>
#include<stdlib.h>
typedef struct aa

int data;
struct aa *next;
NODE;
fun(NODE *h)

int max=-1;
NODE *p;
/***********found************/
p=h;
while(p)

if(p->data>max)
max=p->data;
/************found************/
p=h->next;

return max;

outresult(int s, FILE *Pf)

fprintf(pf, "/nThe max in link: %d/n", s);

NODE *creatlink(int n, int m)

NODE *h, *p, *s, *q;
int i, x;
h=p=(NODE *)malloc(sizeof(NODE));
h->data=9999;
for(i=1; i<=n; i++)

s=(NODE *)malloc(sizeof(NODE));
s->data=rand( )%m; s->next=p->next;
p->next=s; p=p->next;

p->next=NULL;
return h;

outlink(NODE *h, FILE *pf)

[填空题]给定程序的功能是:从键盘输入若干行文本(每行不超过80个字符),并写入文件myfile4.txt中,用-1作为字符串输入结束的标志,然后将文件的内容读出显示在屏幕上。文件的读写分别由自定义函数ReadText和WriteText实现。
[注意] 部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。
[试题源程序]
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
void WriteText(FILE *);
void ReadText(FILE *);
main( )

FILE *fp;
if((fp=fopen("myfile4.txt", "W"))==NULL)

printf("open fail !!/n"); exit(0);

WriteText(fp);
fclose(fp);
if((fp=fopen("myfile4.txt", "r"))==NULL)
printf("open fail !!1/n"); exit(0);

ReadText(fp);
fclose(fp);

/*********found*********/
void WriteText(FILE (1) )

char str[81];
printf("/nEnter string with -1 to end :/n");
gets(str);
while(strcmp(Str, "-1")!=0)
/**********found*********/
fputs( (2) , fw);
fputs("/n", fw);
gets(str);


void ReadText(FILE *fr)


我来回答:

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

订单号:

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