为了正常的体验网站,请在浏览器设置里面开启Javascript功能!
首页 > 青岛科技大学c语言期末考试题1

青岛科技大学c语言期末考试题1

2018-03-04 19页 doc 53KB 78阅读

用户头像

is_597436

暂无简介

举报
青岛科技大学c语言期末考试题1青岛科技大学c语言期末考试题1 一、单项选择题(15个小题,每题2分,共30分): 1(一个C语言程序的执行是从_____。 A(main函数开始,直到main函数结束 B(第一个函数开始,直到最后一个函数结束 C(第一个函数开始,直到最后一个语句结束 D(main函数开始,直到最后一个函数结束 2. 正确的自定义标识符是_____。 A(x_2 B(a-b C(2sum D($123 3(下面程序的运行结果是_____。 #define F(x) x*x void main( ) { int a=2,b...
青岛科技大学c语言期末考试题1
青岛科技大学c语言期末1 一、单项选择题(15个小题,每题2分,共30分): 1(一个C语言程序的执行是从_____。 A(main函数开始,直到main函数结束 B(第一个函数开始,直到最后一个函数结束 C(第一个函数开始,直到最后一个语句结束 D(main函数开始,直到最后一个函数结束 2. 正确的自定义标识符是_____。 A(x_2 B(a-b C(2sum D($123 3(下面程序的运行结果是_____。 #define F(x) x*x void main( ) { int a=2,b=1; prinft(“%d\n”,F(a+b)); } A(3 B(5 C(8 D(9 4(读以下程序段,判断a的值为_____。 int *p,a=10,b=1; p=&a; a=*p+b; A(12 B(10 C(11 D(编译出错 5(根据以下说明语句,则下面的叙述中不正确的是_____。 struct student { int num; char name[10]; int score; }stu; A(struct是定义结构体类型的关键字 B(stu是结构体变量名 C(num, name, score都是结构体成员名 D(stu是结构体类型名 6(已知字母A的ASCII码为十进制数65,变量ch1为字符型,则执行语句ch1=‘A’+‘5’-‘2’;后, ch1中的值是_____。 A(D B(67 C(一个不确定的值 D(C 7(以下哪种不能对一维数组进行正确的初始化_____。 A(int a[ ]={1,2,3}; B(int a[5]={ }; C(int a[5]=(1,2,3,4,5); D(int a[ ]={2,3,4*5,6}; 8(已正确定义字符变量ch1,下面能正确赋值的是_____。 A(ch1=“a”; B(ch1=‘a’; C(ch1=“C语言程序设计”; D(ch1,‘ C语言程序设计’; 9(逗号达式 (a=3*4,a*4),a+5 的值是_____。 A(53 B(17 C(20 D(48 10(设n为float型,m为int型,则以下能实现将n中的数值保留小数点后两位,第三位进行四舍五入 的表达式是_____。 A(n=(n*100+0.5)/100.0 B(n=n*100+0.5/100.0 personal credit business process management, and development of business processes, clear the loan object and scope, establish loan operation of assessment and accountability mechanisms. Diversity management principles the Bank's strict separation between business and consumer use of personal credit, then according to the different varieties of business to establish the appropriate access standard, post-lending management requirements. Business use personal credit should be strictly in accordance with the qilu Bank's small business credit risk management guidelines and associated working capital loans management requirements, such as assessing the management of production and operation, repayment ability, the level of risk, and so on. Income debt ratio control principle of Bank income debt ratio control mechanism, combined with the borrower's income, debt, expenditures, loans, guarantees and other factors, determines the loan amount and term, control each repayment does not exceed the amount of the borrower repayment ability. Principles of trans-regional limits Branches shall not in principle to operating income mainly comes from offsite (prefecture-level cities and administrative divisions at or above) or inward (MS) charge provided credit support for individual customers is located in different places, but except those with unique advantages such as critical. Have set up branches in different places, other bodies are not entitled to carry out the branch of credit business in the region. Branch County area has been established, other bodies are not entitled to apply for the credit within the County. Double before going through the personal credit business credit investigation, Contracting, security verification, credit check, key account manager should be double handle. Bank supports risk managers, loan review, professional C(m=n*100+0.5,n=m/100.0 D(n=(n/100+0.5)*100.0 11(设i=2,j=3,则表达式(i++)*(++j)的值为_____。 A(6 B(8 C(9 D(12 12(关于以下程序段,说法正确的是_____。 x=-1; do { x=x*x; }while(!x); A(死循环 B(循环体执行二次 C(循环体执行一次 D(有语法错误 13(若有下列定义:char c[5],*p=c; 则对c数组元素地址的正确引用是_____。 A(p+2 B(&c[5] C(c++ D(&c 14(当调用函数时,实参是一个数组名,则向函数传送的是_____。 A(数组的长度 B(数组每个元素中的值 C(数组每一个元素的地址 D(数组的首地址 15(文件中利用fopen函数打开文件,如果以只读方式打开二进制文件,则以下打开方式正确的是_____。 A(r+ B(rb C(wb D(ab 二、填空题(5个小题,每题2分,共10分): 1(若有int i=1,j=7,a; 执行语句 a=i+(j%4!=0); 后,a的值是_______。 2(执行以下程序后,运行结果是_______。 #include void main( ) { int a,b; for(a=1,b=1;a<=100;a++) { if(b>=10) break; if(b%3==1) { b+=3; continue; } } printf(“%d\n”,a);} 3(源程序中用到了strcat函数,需要包含的头文件(即库文件)为_______。 4(执行以下程序后,运行结果是_______。 #include void main( ) { int a=2; float n=5.888,b; b=a+(int)n; printf(“%f\n”,b);} 5(语句 scanf("a=%d,b=%d",&a,&b); 若将3和4分别输入给a和b,则正确的输入方式为____ 。 三、程序分析题,写出程序的运行结果(5个小题,每题4分,共20分): 1(#include void main( ) { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0: a++; break; case 1: b++; break; } personal credit business process management, and development of business processes, clear the loan object and scope, establish loan operation of assessment and accountability mechanisms. Diversity management principles the Bank's strict separation between business and consumer use of personal credit, then according to the different varieties of business to establish the appropriate access standard, post-lending management requirements. Business use personal credit should be strictly in accordance with the qilu Bank's small business credit risk management guidelines and associated working capital loans management requirements, such as assessing the management of production and operation, repayment ability, the level of risk, and so on. Income debt ratio control principle of Bank income debt ratio control mechanism, combined with the borrower's income, debt, expenditures, loans, guarantees and other factors, determines the loan amount and term, control each repayment does not exceed the amount of the borrower repayment ability. Principles of trans-regional limits Branches shall not in principle to operating income mainly comes from offsite (prefecture-level cities and administrative divisions at or above) or inward (MS) charge provided credit support for individual customers is located in different places, but except those with unique advantages such as critical. Have set up branches in different places, other bodies are not entitled to carry out the branch of credit business in the region. Branch County area has been established, other bodies are not entitled to apply for the credit within the County. Double before going through the personal credit business credit investigation, Contracting, security verification, credit check, key account manager should be double handle. Bank supports risk managers, loan review, professional case 2: a++; b++; break;} printf(“a=%d,b=%d\n”,a,b);} 2(在运行以下程序时,输入“Turbo C++ 3.0”,写出程序的运行结果。 #include void main( ) { char str[40]; printf("Input a string:"); scanf("%s",str); puts(str);} 3(#include void f(int y) { static int i=5; int j=3; j++; printf(“%d+%d+%d=%d\n”,i,j,y,i+j+y); i*=2;} void main( ) { int x; for(x=1;x<=2;++x) f(x);} 4(#include void swap(int *pa,int *pb) { int *p; p=pa; pa=pb; pb=p; } void main( ) { int a=10,b=20; int *p1=&a,*p2=&b; if(a int a=5; int b=7; int plus(int x,int y) { int z; z=x+y; return (z);} void main( ) { int a=4,b=5,c; c=plus(a,b); printf(“a+b=%d\n”,c); } 四、程序填空题,将下面程序补充完整(10个填空,每空2分,共20分): 1(输出九九表。 #include “stdio.h” void main( ) personal credit business process management, and development of business processes, clear the loan object and scope, establish loan operation of assessment and accountability mechanisms. Diversity management principles the Bank's strict separation between business and consumer use of personal credit, then according to the different varieties of business to establish the appropriate access standard, post-lending management requirements. Business use personal credit should be strictly in accordance with the qilu Bank's small business credit risk management guidelines and associated working capital loans management requirements, such as assessing the management of production and operation, repayment ability, the level of risk, and so on. Income debt ratio control principle of Bank income debt ratio control mechanism, combined with the borrower's income, debt, expenditures, loans, guarantees and other factors, determines the loan amount and term, control each repayment does not exceed the amount of the borrower repayment ability. Principles of trans-regional limits Branches shall not in principle to operating income mainly comes from offsite (prefecture-level cities and administrative divisions at or above) or inward (MS) charge provided credit support for individual customers is located in different places, but except those with unique advantages such as critical. Have set up branches in different places, other bodies are not entitled to carry out the branch of credit business in the region. Branch County area has been established, other bodies are not entitled to apply for the credit within the County. Double before going through the personal credit business credit investigation, Contracting, security verification, credit check, key account manager should be double handle. Bank supports risk managers, loan review, professional { int i,j; for(i=1;i<=9;i++) {for(j=1; ? ;j++) printf(“%3d*%d=%2d”,i,j,i*j); ? ; } } 2(利用函数形式,求x数组所有元素的平均值并输出。 #include “stdio.h” ? ; void main( ) { float avg,x[10]={1.2,3.6,4.5,5.1,6.9,7,8,9,10.5,11.3}; avg=average(x); printf(“The average is %5.2f\n”,avg); } float average(float a[10]) { int i; float sum=0; for(i=0;i<10;i++) sum=sum+a[i]; ? ; } 3(编写一个计算字符串长度的函数length。 #include “stdio.h” void main( ) { char str[20]; int m; int length(char *p); printf("Input a string:\n"); gets(str); ? ; printf("\n the length of str is%d ",m); } int length(char *p) { int n=0; while( ? ) { n++; p++; } return n;} 4(输入10个整数,按每行3个数输出这些整数,最后输出10个整数的平均值。 #include “stdio.h” void main( ) { int i,n=10,a[10]; float avg=0; for(i=0;i=‘A’&&*cp<=‘Z’) ? ; else if(*cp>=‘a’&&*cp<=‘z’) *cp=*cp-32; ? ; } uts(str); p } 五、程序设计题(3个小题,共20分): 1(设三个整型变量a,b,c,编写程序为a,b,c输入数据,并a,b,c按由小到大排序后输出。(5分) 2(学生成绩可分为五分制与百分制,编程将百分制转换为五分制输出。(5分) 3(编写排序函数sort(int a[ ]),实现对数组a中的元素进行排序,并利用该函数,从键盘输入若干个 数(如10个)将其按升序排列。(10分) 第一套试题 一、单项选择题(15个小题,每题2分,共30分): 1-5:AABCD 6-10:ACBBC 11-15:BCADB 二、填空题(5个小题,每题2分,共10分): (2 2(4 3(string.h 1 4(7.000000 5(a=3,b=4 三、程序分析题,写出程序的运行结果(5个小题,每题4分,共20分): 1(a=2,b=1 2(Turbo 3(5+4+1=10 4(10,20 5(a+b=9 10+4+2=16 四、程序填空题,将下面程序补充完整(10个填空,每空2分,共20分): 1(?j<=i ?printf(“\n”) 2(?float average(float a[10]) 或 float average(float a[ ]) ?return (sum/10) 3(?m=length(str) ?*p!=‘\0’ 或 *p 4(?i%3==0 ?avg+=a[i] 或 avg=avg+a[i] personal credit business process management, and development of business processes, clear the loan object and scope, establish loan operation of assessment and accountability mechanisms. Diversity management principles the Bank's strict separation between business and consumer use of personal credit, then according to the different varieties of business to establish the appropriate access standard, post-lending management requirements. Business use personal credit should be strictly in accordance with the qilu Bank's small business credit risk management guidelines and associated working capital loans management requirements, such as assessing the management of production and operation, repayment ability, the level of risk, and so on. Income debt ratio control principle of Bank income debt ratio control mechanism, combined with the borrower's income, debt, expenditures, loans, guarantees and other factors, determines the loan amount and term, control each repayment does not exceed the amount of the borrower repayment ability. Principles of trans-regional limits Branches shall not in principle to operating income mainly comes from offsite (prefecture-level cities and administrative divisions at or above) or inward (MS) charge provided credit support for individual customers is located in different places, but except those with unique advantages such as critical. Have set up branches in different places, other bodies are not entitled to carry out the branch of credit business in the region. Branch County area has been established, other bodies are not entitled to apply for the credit within the County. Double before going through the personal credit business credit investigation, Contracting, security verification, credit check, key account manager should be double handle. Bank supports risk managers, loan review, professional 5(?*cp=*cp+32或*cp=*cp+‘a’-‘A’ ?cp++ 五、程序设计题(3个小题,共20分): 1(#include “stdio.h” void main( ) { int a,b,c,t; printf("input a,b and c:"); scanf("%d%d%d",&a,&b,&c); „„1分 if(a>b) { t=a; a=b; b=t; } „„3分 if(a>c) { t=a; a=c; c=t; } if(b>c) { t=b; b=c; c=t; } printf("%d%d%d",a,b,c); „„1分 } 2(#include “stdio.h” void main( ) { float score; printf(“Input a score:”); scanf(“%f”,&score); while(score>100||score<0) „„2分 { printf(“Error! Please input again:\n”); scanf(“%f”,&score); } if(score>=90) printf(“A\n”); „„3分 else if(score>=80) printf(“B\n”); else if(score>=70) printf(“C\n”); else if(score>=60) printf(“D\n”); else printf(“E\n”); } 3(#include "stdio.h" #define N 10 void sort(int a[ ]); „„1分 void main( ) { int a[N],i,j; printf("input %d numbers:\n",N); for(i=0;ia[j+1]) personal credit business process management, and development of business processes, clear the loan object and scope, establish loan operation of assessment and accountability mechanisms. Diversity management principles the Bank's strict separation between business and consumer use of personal credit, then according to the different varieties of business to establish the appropriate access standard, post-lending management requirements. Business use personal credit should be strictly in accordance with the qilu Bank's small business credit risk management guidelines and associated working capital loans management requirements, such as assessing the management of production and operation, repayment ability, the level of risk, and so on. Income debt ratio control principle of Bank income debt ratio control mechanism, combined with the borrower's income, debt, expenditures, loans, guarantees and other factors, determines the loan amount and term, control each repayment does not exceed the amount of the borrower repayment ability. Principles of trans-regional limits Branches shall not in principle to operating income mainly comes from offsite (prefecture-level cities and administrative divisions at or above) or inward (MS) charge provided credit support for individual customers is located in different places, but except those with unique advantages such as critical. Have set up branches in different places, other bodies are not entitled to carry out the branch of credit business in the region. Branch County area has been established, other bodies are not entitled to apply for the credit within the County. Double before going through the personal credit business credit investigation, Contracting, security verification, credit check, key account manager should be double handle. Bank supports risk managers, loan review, professional { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } personal credit business process management, and development of business processes, clear the loan object and scope, establish loan operation of assessment and accountability mechanisms. Diversity management principles the Bank's strict separation between business and consumer use of personal credit, then according to the different varieties of business to establish the appropriate access standard, post-lending management requirements. Business use personal credit should be strictly in accordance with the qilu Bank's small business credit risk management guidelines and associated working capital loans management requirements, such as assessing the management of production and operation, repayment ability, the level of risk, and so on. Income debt ratio control principle of Bank income debt ratio control mechanism, combined with the borrower's income, debt, expenditures, loans, guarantees and other factors, determines the loan amount and term, control each repayment does not exceed the amount of the borrower repayment ability. Principles of trans-regional limits Branches shall not in principle to operating income mainly comes from offsite (prefecture-level cities and administrative divisions at or above) or inward (MS) charge provided credit support for individual customers is located in different places, but except those with unique advantages such as critical. Have set up branches in different places, other bodies are not entitled to carry out the branch of credit business in the region. Branch County area has been established, other bodies are not entitled to apply for the credit within the County. Double before going through the personal credit business credit investigation, Contracting, security verification, credit check, key account manager should be double handle. Bank supports risk managers, loan review, professional
/
本文档为【青岛科技大学c语言期末考试题1】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索