C50-8.83/0.118型抽汽凝汽式机组的热化抽汽量为193 387 kg/h,回水比焓为334.94 kJ/kg,供热抽汽比焓为2 620.52 kJ/kg,则该机组的热化供热量为()GJ/h。
A.380
B.352
C.442
D.456
A.380
B.352
C.442
D.456
第1题
阅读下列程序说明和C程序,将应填入(n)处的字句写在对应栏内。
[函数2.1说明]
下面程序的功能是计算x和y的最小公倍数。
[函数2.1]
main()
{ int m,n,d,r;
seanf("%d %d",&m,&n);
if(m<n) {r=m;m=n;n=r;}
(1);
while (d%n! =0) (2);
printf("%d\n",d);
}
[函数2.2说明]
下述程序接收键盘输入,直到句点“.”时结束。输入的字符被原样输出,但连续的空格输入将转换成一个空格。
[函数2.2]
include <stdio.h>
main()
{ char c,preChar='\0';
c = getchar();
while(c! = '.'){
if((3)) putchar(c);
else if(preChar! =' ') putchar(c);
(4);
c=(5);
}
}
第2题
阅读下列函数说明和C函数,将应填入(n)处的字句写在对应栏内。
[函数2.1说明]
函数strcpy的功能是将字符串str2的内容复制到字符申str1。
[函数2.1]
(1) strcpy (char *slr1, const char *str2)
{ char * temp;
while(* str2!='\0') *cp++ =(2);
(3)='\0';
return str1;
}
[函数2.2说明]
函数int strcmp(const char *str1, const char *str2)的功能是按字典序比较两个字符串str1和str2的大小。当str1<str2时返回-1,当str1>str2时返回1,否则返回0。
[函数2.2]
int strcmp(const char *str1, const char *str2)
{ while(*str1= =* str2) {
if(* s1= =(4)) return 0;
s1++;
(5);
}
if(*str1<*str2) return -1;
return 1;
}
第3题
阅读下列函数说明和C函数,将应填入(n)处的字句写在对应栏内。
[函数2.1说明]
Fibonacci数列中头两个数均为1,从第三个数开始,每个数等于前两个数之和。下述程序计算Fibonacci数列中前15个数,并以每行5个数的格式输出。
[函数2.1]
include <stdio.h>
main()
{ int i,f,f1=1,f2=1;
printf("%5d%5d",f1,f2);
for(i=3;i<=15;i++){
f=(1);
printf("%5d",f);
if((2)= =0) printf("\n");
f1=12;
(3);
}
}
[函数2.2说明]
函数fun(char *str1,char *str2)的功能是将字符串str2拼接到str1之后。
[函数2.2]
fun(char *str1,char *str2)
{ int i,j;
for(i=0;str1[i]!='\0';i++);
for(j=0;str2[j]!='\0';j++) (4);
(5);
}
第4题
阅读下列程序说明和C代码,将应填入(n)处的字句写在对应栏内。
[说明]
函数Printprime(int UpBound)的功能是输出1到UpBound以内的全体素数。
[函数2.1]
void PrintPrime(int UpBound)
printf("2," );
for(i=3; i<UpBound; i+ =2) {
int k = sqrt(i);
for(j=3; j<= k;(1)) /*检查i是否有3到k以入的奇因数*/
if((2)) break;
fi((3)) printf("%d", i);
[函数2.2说明]
递归函数invert(int a[],int k),int k)的功能是将数组a中的前k个元素逆置。
[函数2.2]
void invert(int a[ ], int k)
{ int t;
if ((4)) {
invert((5));
t=a[0];
a[0] =a[k-1];
a[k-l]=t;
}
}
第5题
阅读以下函数说明和C语言函数,将应填入(n)处的字句写在对应栏内。
【程序2.1说明】
求所有满足如下条件的三位数:它除以11得的商等于它各位数字的平方和。例如 550,除以11商为50,50=52+52+02。
【程序2.1】
void main()
{
int i, j,n,s;
for(i=100;i<=999;i++)
{
n=i;
j=n/11;
s=0;
while((1))
{
(2)
n/=10;
}
if((3))
printf("%d\t",i);
}
}
【程序2.2说明】
本程序输入一字符串,将其中的大写字母改变成小写字母。
【程序2.2】
void main()
{
int i=0;
char s[120];
scanf("%s",s);
while((4))
{
if((5))
s[i]=s[i]- 'A'+'a';
i++;
}
printf("%s\n",s);
}
第6题
阅读下列函数说明和C代码,将应填入(n)处的字句写在对应栏内。
【说明】
函数QuickSort是在一维数组A[n]上进行快速排序的递归算法。
【函数】
void QuickSort(int A[ ],int s,int t)
{ int i=s,j=t+1,temp;
int x=A[s];
do{
do i ++ ;while (1);
do j -- ;while(A[j]>x);
if(i<j){temp=A[i];(2);(3);}
}while(i<j);
A[a] =A[j];A[j] =x;
if(s<i-1) (4);
if(j+1<t) (5);
}
第7题
●试题四
阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
函数QuickSort是在一维数组A[n]上进行快速排序的递归算法。
【函数】
void QuickSort(int A[],int s,int t)
{int i=s,j=t+1,temp;
int x=A[s];
do{
do i++;while (1) ;
do j--;while(A[j]>x);
if(i<j){temp=A[i]; (2) ; (3) ;}
}while(i<j);
A[a]=A[j];A[j]=x;
if(s<i-1) (4) ;
if(j+1<t) (5) ;
}
第8题
阅读以下函数说明和C语言函数,将应填入(n)处的字句写在答题纸的对应栏内。
【函数2.1说明】
递归函数sum(int a[], int n)的返回值是数组a[]的前n个元素之和。
【函数2.1】
int sum (int a[],int n)
{
if(n>0) return (1);
else (2);
}
【函数2.2说明】
有3个整数,设计函数compare(int a,int b,int c)求其中最大的数。
【函数2.2】
int compare (int a, int b, int c )
{ int temp, max;
(3) a:b;
(4) temp:c;
}
【函数2.3说明】
递归函数dec(int a[],int n)判断数组a[]的前n个元素是否是不递增的。不递增返回 1,否则返回0。
【函数2.3】
int dec(int a[], int n )
{
if(n<=1) return 1;
if(a[0]<a[1]) return 0;
return (5);
}
第10题
●试题二
阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
该程序运行后,输出下面的数字金字塔
【程序】
include<stdio.h>
main ()
{char max,next;
int i;
for(max=′1′;max<=′9′;max++)
{for(i=1;i<=20- (1) ;++i)
printf(" ");
for(next= (2) ;next<= (3) ;next++)
printf("%c",next);
for(next= (4) ;next>= (5) ;next--)
printf("%c",next);
printf("\n");
}
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!