万维考试系统C语言题库程序设计题导出113道1

上传人:痛*** 文档编号:85311255 上传时间:2022-05-05 格式:DOC 页数:102 大小:299.50KB
收藏 版权申诉 举报 下载
万维考试系统C语言题库程序设计题导出113道1_第1页
第1页 / 共102页
万维考试系统C语言题库程序设计题导出113道1_第2页
第2页 / 共102页
万维考试系统C语言题库程序设计题导出113道1_第3页
第3页 / 共102页
资源描述:

《万维考试系统C语言题库程序设计题导出113道1》由会员分享,可在线阅读,更多相关《万维考试系统C语言题库程序设计题导出113道1(102页珍藏版)》请在装配图网上搜索。

1、King shop school car to watch the summary view store is located in the LAN-Xin railway, 215 students, and students to and from school has about 90 people to cross the railway, more than half of the students live in the school in the vicinity of the rail line along the railway more than 10 square kil

2、ometers. Railway is economy of artery, to makes railway along general people master railway legal regulations and security knowledge, enhanced love road watch consciousness, ensure railway security smooth, years, I school has been put love road watch work as education students of focus to caught, ma

3、de has significantly of effect, years no occurred had railway security accident, emerged out a and a love road watch small guard, General teachers and students and masses of love road watch consciousness General improve, times by superior recognition, Our practices are reporting on is as follows. An

4、d improve the Organization, love the way of protection responsibilities. Set up by the principal of the school is the head security administrator for the Deputy Head of the class teacher for members of the railway protection leading group for propaganda and education, consisting of offices, advocacy

5、 groups, education groups and steering groups, organizations responsible for railway protection publicity and education of the whole school, command and coordination. To ensure safety of the railway for the overall objectives, major tasks are: 1, arouse the enthusiasm of teachers, school advantages

6、into full play, watch the propaganda and education work of joint railway. 2, railway watch teacher and student awareness, to ensure against road-related casualties. 3, education in primary and middle school students the courage to fight against the Railway Safety Act and found to have damaged railwa

7、y safety relevant parts of the report in a timely manner to ensure railway safety. Do Division, responsibility and student teacher assessment, evaluation and love road linked to the protection and safety, enhance the sense of responsibility. Second, programming, watch love road work routine. School

8、developed has railway watch publicity education work programme, put love road watch work into school education teaching plans, full using class teaching, and theme class, timing, education students learning railway method, about love road security matters, school requirements daily of campus broadca

9、st to has five minutes of railway security knowledge education, all class weekly are to Shang a section love road watch aspects of security class, monthly introduced a period love road watch aspects of window publicity, reached has alarm ringing of effect. Third, explicitly demanded that the love ro

10、ad protection work. Schools to establish and improve a love road watch schedule, enacted the railway safety ten no Protocol, the Convention on the safety and other regulations and requirements, so as to enable departments to further their work. Which publicity group is responsible for railway watch

11、legal regulations and about common sense of publicity, annual organization a to two times above railway method, and security management Punishment Ordinance, for main content of publicity, further strengthened General teachers and students of concept and love road watch consciousness, education stud

12、ents do three not: that not to railway Shang play, without stones, hit train, is not rail Shang stacked roadblocks. Education groups to include railway protection knowledge education in carrying out quality education, class of railway transport in the main channel of textbooks in economic constructi

13、on in the role and significance of guiding students to take care of the railway一、程序设计 共113题 (共计1130分)第1题 (10.0分) 题号:390/*-【程序设计】-功能:编写函数求1100中奇数的平方和。 结果为166650.000000。-*/#include void wwjt(); float sum(int n) /*Program*/ /* End */答案:-float s=0; int i; for(i=1;i=n;i=i+2) s=s+i*i; return(s);-第2题 (10.0

14、分) 题号:320/*-【程序设计】-功能:在键盘上输入一个3行3列矩阵的各个元素的值(值 为整数),然后输出主对角线元素的积,并在fun() 函数中输出。-*/#include void wwjt(); main() int i,j,s,a33; for(i=0;i3;i+) for(j=0;j3;j+) scanf(%d,&aij); s=fun(a); printf(Sum=%dn,s); wwjt();int fun(int a33) /*Program*/ /* End */ 答案:-int sum;int i,j;sum=1;for(i=0;i3;i+) sum=sum*aii;

15、return sum;-第3题 (10.0分) 题号:324/*-【程序设计】-功能:能计算从1开始到n的自然数中偶数的平方的和,n由 键盘输入,并在main()函数中输出。(n是偶数)-*/#include void wwjt(); int fun(int n) /*Program*/ /* End */ main() int m; printf(Enter m: ); scanf(%d, &m); printf(nThe result is %dn, fun(m); wwjt(); 答案:-int sum,i;sum =0;for(i=2;i=n;i=i+2)sum=sum+i*i;ret

16、urn(sum);-第4题 (10.0分) 题号:345/*-【程序设计】-功能:将两个两位数的正整数a、b合并形成一个整数放在c 中。合并的方式是:将a数的十位和个位数依次放在 c数的千位和十位上, b数的十位和个位数依次放在 c数的个位和百位上。 例如:当a45,b=12。调用该函数后,c=4251。 -*/#include void wwjt(); void fun(int a, int b, long *c) /*Program*/ /* End */main() int a,b; long c; printf(input a, b:); scanf(%d%d, &a, &b); fu

17、n(a, b, &c); printf(The result is: %ldn, c); wwjt(); 答案:-*c=a/10*1000+a%10*10+b/10+b%10*100;- 第5题 (10.0分) 题号:366/*-【程序设计】功能:求一组数中大于平均值的数的个数。例如:给定的一组数为1,3,6,9,4,23,35,67,12,88时,函 数值为3。-*/ #include void wwjt(); int fun(int a,int n) /*Program*/ /* End */ main() int a10=1,3,6,9,4,23,35,67,12,88; int y;

18、y=fun(a,10); printf(y=%dn,y); wwjt();答案:-int i,k=0; float s=0,ave; for(i=0;in;i+) s+=ai; ave=s/n; printf(%f ,ave); for(i=0;iave)k+; return k;-第6题 (10.0分) 题号:355 /*-【程序设计】-功能:对长度为8个字符的字符串,将8个字符按降序排列。例如:原来的字符串为CEAedcab,排序后输出为edcbaECA。-*/#include#include#includevoid wwjt(); void fun(char *s,int num) /*

19、Program*/ /* End */main() char s10; printf(输入8个字符的字符串:); gets(s); fun(s,8); printf(n%s,s); wwjt();答案:- int i,j; char t; for(i=0;inum;i+) for(j=i+1;jnum;j+) if(sisj) t=si;si=sj;sj=t;-第7题 (10.0分) 题号:44/*-【程序设计】-功能:求出二维数组周边元素之和,作为函数值返回。二 维数组的值在主函数中赋予。-*/#define M 4#define N 5#include void wwjt(); int f

20、un(int aMN)/*Program*/* End */main()int aMN=1,3,5,7,9,2,4,6,8,10,2,3,4,5,6,4,5,6,7,8;int y;y=fun(a);printf(s=%dn,y);wwjt();答案:-int s=0; int i,j; for(i=0;iM;i+) s=s+ai0+aiN-1; for(j=1;jN-1;j+) s=s+a0j+aM-1j; return s;-第8题 (10.0分) 题号:339/*-【程序设计】-功能:判断整数x是否是同构数。若是同构数,函数返回1; 否则返回0。x的值由主函数从键盘读入,要求不大 于10

21、0。说明:所谓“同构数”是指这样的数,这个数出现在它的 平方数的右边。例如:输入整数5,5的平方数是25,5是25中右侧的数,所 以5是同构数。-*/#include void wwjt(); int fun(int x) /*Program*/ /* End */main() int x,y; printf(nPlease enter a integer numbers:); scanf(%d,&x); if(x100) printf(data error!n); exit(0); y=fun(x); if(y) printf(%d YESn,x); else printf(%d NOn,x

22、); wwjt(); 答案:- int k; k=x*x; if(k%10=x)|(k%100=x) return 1; else return 0;-第9题 (10.0分) 题号:383/*-【程序设计】-功能:用函数实现字符串的复制, 不允许用strcpy()函数。-*/#include void wwjt(); void copy(char str1,char str2) /*Program*/ /* End */main() void copy(); char c140,c240; gets(c1); copy(c1,c2); puts(c2); wwjt();答案:-int i; f

23、or(i=0;str1i!=0;i+) str2i=str1i; str2i=0;-第10题 (10.0分) 题号:310/*-【程序设计】-功能:计算并输出给定整数n的所有因子之和(不包括1与 自身)。注意:n的值不大于1000。例如:n的值为855时,应输出704。-*/#include void wwjt(); int fun(int n) /*Program*/ /* End */ main() printf(s=%dn,fun(855); wwjt();答案:-int s=0,i; for(i=2;in;i+) if(n%i=0)s=s+i; return s;-第11题 (10.0

24、分) 题号:354/*-【程序设计】-功能:求小于lim的所有素数并放在aa数组中,该函数返回 所求出素数的个数。-*/#include#include#define MAX 100void wwjt(); int fun(int lim,int aaMAX) /*Program*/ /* End */main() int limit,i,sum; int aaMAX; printf(Please input ainteger:); scanf(%d,&limit); sum=fun(limit,aa); for(i=0;isum;i+) if(i%10=0&i!=0) printf(n);

25、printf(%5d,aai); wwjt();答案:- int n=0; int i,j; for(i=2;i=lim;i+) for(j=2;ji;j+) if(i%j=0) break; if(j=i) aan+=i; return n;-第12题 (10.0分) 题号:341/*-【程序设计】-功能:删除所有值为y的元素。数组元素中的值和y的值由 主函数通过键盘输入。-*/#include #include#include#define M 20void wwjt(); void fun(int bb,int *n,int y) /*Program*/ /* End */main()

26、int aaM,n,y,k; printf(nPlease enter n:);scanf(%d,&n); printf(nEnter %d positive number:n,n); for(k=0;kn;k+) scanf(%d,&aak); printf(The original data is:n); for(k=0;kn;k+) printf(%5d,aak); printf(nEnter a number to deletede:);scanf(%d,&y); fun(aa,&n,y); printf(The data after deleted %d:n,y); for(k=0;

27、kn;k+) printf(%4d,aak); printf(n); wwjt();答案:- int i,j; for(i=0;i*n;) if(bbi=y) for(j=i;j*n;j+) bbj=bbj+1; *n=*n-1; else i+; -第13题 (10.0分) 题号:317/*-【程序设计】-功能:求出NM整型数组的最大元素及其所在的行坐标及 列坐标(如果最大元素不唯一,选择位置在最前面 的一个)。例如:输入的数组为: 1 2 3 4 15 6 12 18 9 10 11 2 求出的最大数为18,行坐标为2,列坐标为1。-*/#define N 4#define M 3#inc

28、lude void wwjt(); int Row,Col;int fun(int arrayNM) /*Program*/ /* End */ main() int aNM,i,j,max; printf(input a array:); for(i=0;iN;i+) for(j=0;jM;j+) scanf(%d,&aij); for(i=0;iN;i+) for(j=0;jM;j+) printf(%d,aij); printf(n); max=fun(a); printf(max=%d,row=%d,col=%d,max,Row,Col); wwjt();答案:-int max,i,j

29、;max=array 00;Row=0;Col=0;for(i=0;iN;i+) for(j=0;jM;j+) if(maxarray ij) max=array ij; Row=i;Col=j;return(max);-第14题 (10.0分) 题号:392/*-【程序设计】-功能:求一批数中最大值和最小值的积。-*/#define N 30#include stdlib.h#include void wwjt(); int max_min(int a,int n) /*Program*/ /* End */main() int aN,i,k; for(i=0;iN;i+) ai=rando

30、m(51)+10; for(i=0;iN;i+) printf(%5d,ai); if(i+1)%5=0) printf(n); k=max_min(a,N); printf(the result is:%dn,k); wwjt();答案:- int i,max,min; max=min=a0; for(i=1;imax) max=ai; else if(aimin) min=ai; return(max*min);-第15题 (10.0分) 题号:501#include /*-【程序设计】-题目:从键盘输入一个大写字母,要求改用小写字母输出。-*/#include void wwjt();

31、char fun(char c) /*Program*/ /* End */ void main() char c1, c2; printf(Please input a char:); c1=getchar(); printf(%c,%dn,c1,c1); c2=fun(c1); printf(%c,%dn,c2,c2); wwjt(); fclose(IN); fclose(OUT);答案: c=c+32; return c;第16题 (10.0分) 题号:502题目:用while语句求1100的累计和。#include /*-void wwjt(); int fun(int n) /*P

32、rogram*/ /* End */ void main() int sum = 0; sum=fun(100); printf (sum = %dn, sum); wwjt();答案: int i=1,sum=0; while(i=n) sum=sum+i; i+; return sum;第17题 (10.0分) 题号:409/*-【程序设计】-题目:输入华氏温度求摄氏温度。转换公式为 c=5/9(f-32), 输出结果取两位小数。-*/#include void wwjt(); double fun(double m) /*Program*/ /* End */ void main() d

33、ouble c,f; printf(请输入一个华氏温度:); scanf(%f,&f); c=fun(f); printf(摄氏温度为:%5.2fn,c); wwjt();答案: float n; n=(5.0/9.0)*(m-32); return n; 第18题 (10.0分) 题号:29/*-【程序设计】-功能:对任意输入的 x,用下式计算并输出 y 的值。 5 x10-*/#includevoid wwjt();int fun(int n) /*Program*/ /* End */ void main () int x,y; printf(enter x:); scanf(%d,&x

34、); y=fun(x); printf(x=%d,y=%dn,x,y); wwjt();答案: int m; if(n=10) if(n10) m=-5; else m=0; else m=5;return m;第19题 (10.0分) 题号:382/*-【程序设计】-功能:给定n个数据, 求最小值出现的位置(如果最小值 出现多次,求出第一次出现的位置即可)。-*/#include void wwjt(); int station(int s,int n) /*Program*/ /* End */main() int a100,n,i,t; scanf(%d,&n); for(i=0;in;

35、i+) scanf(%d,&ai); t=station(a,n); printf(the min_value position is:%dn,t); wwjt();答案:-int i,k; k=0; for(i=1;in;i+) if(sisk) k=i; return(k);-第20题 (10.0分) 题号:367/*-【程序设计】-功能:找出一批正整数中的最大的偶数。-*/#include void wwjt(); int fun(int a,int n) /*Program*/ /* End */ main() int a=1,2,9,24,35,18,k; k=fun(a,6); p

36、rintf(max=%dn,k); wwjt();答案:-int i,amax=-1; for(i=0;iamax) amax=ai; return amax;-第21题 (10.0分) 题号:384/*-【程序设计】-功能:产生20个30,120上的随机整数放入二维数组a54 中,求每行元素的和。-*/#include stdlib.h#include void wwjt(); void row_sum(int a54,int b5) /*Program*/ /* End */main() void row_sum(); int a54,b5,i,j; for(i=0;i5;i+) for(

37、j=0;j4;j+) aij=random(120-30+1)+30; for(i=0;i5;i+) for(j=0;j4;j+) printf(%5d,aij); printf(n); row_sum(a,b); for(i=0;i5;i+) printf(%6d,bi); printf(n); wwjt();答案:- int i,j; for(i=0;i5;i+) bi=0; for(j=0;j4;j+) bi=bi+aij; -第22题 (10.0分) 题号:334/*-【程序设计】-功能:求给定正整数n以内的素数之积。(n28)-*/#include #includeconio.hvoid wwjt(); long fun(int n) /*Program*/ /* End */ main() int m; printf(Enter m: ); scanf(%d, &m); printf(nThe result is %ldn, fun(m); wwjt(); 答案:-long i,k;long s=1; for(i=2;i=n;i+) for(k=2;ki;k+) if(i%k=0)break; if(k=i)s=s*i; return s;第23题 (10.0分) 题号:363/*-【程序设计】-功能:求一个给定字符串中的字母的个数。

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!