[计算机类试卷]国家二级C语言机试(操作题)模拟试卷342(无答案).doc

上传人:figureissue185 文档编号:846897 上传时间:2019-02-21 格式:DOC 页数:3 大小:27.50KB
下载 相关 举报
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷342(无答案).doc_第1页
第1页 / 共3页
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷342(无答案).doc_第2页
第2页 / 共3页
[计算机类试卷]国家二级C语言机试(操作题)模拟试卷342(无答案).doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家二级 C 语言机试(操作题)模拟试卷 342(无答案)一、程序填空题1 给定程序中,函数 fun 的功能是:有 NxN 矩阵,以主对角线为对称线,对称元素相加并将结果存放在左下三角元素中,右上三角元素置为 0。例如,若 N=3,有下列矩阵:1 2 3 计算结果为1 0 04 5 6 6 5 07 8 9 10 14 9请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANK1C 中。不得增行或删行,也不得更改程序的结构!#include #define N 4void fun (int (*t)_1_) int i,j;_3_ =0

2、main () int t N= 21,12,13,24,25,16,47,38,29,11,32,54,42,21,33,10 ,i,j ;printf ( “ nThe originalarray: n“) ; for(j=0; j#include#include #define FU (m,n) (m/n)float fun (float a,float b,float c) float value;value=FU (a+b,a b) +FU (c+b,cb) ;Return (Value) ;main () float x,y,z ,sum ;printf(“Input x y z

3、 “);scanf (“fff“ ,&x ,&y,&z) ;printf ( “x=f,y=f,z=fn“,x,y,z) ;if (x=y|y=z) printf (“Dataerror ! n“) ; exit (0) ; sum=fun (x,y,z) ;printf(“The result is : 52fn“,sum);三、程序设计题3 规定输入的字符串只包含字母和*号。请编写函数 fun,它的功能是:将字符串中的前导*号全部删除,中间和尾部的*号不删除。例如,字符串中的内容为:*A*BC*DEF*G*,删除后,字符串中的内容应当是:A*BC*DEF*G* 。在编写函数时,不得使用

4、C 语言提供的字符串函数。注意:部分源程序在文件 PROG1C 中。请勿改动主函数 main 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。#include void fun (char *a)main()char s81;void NONO ();printf( “Enter a string: n“);gets (s);fun (s);printf (“The string after deleted:n“);puts (s) ;NONO();void NONO()/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。 */FILE *in,*out ;int i ; char sl81 ;in= fopen(“indat“,“r“) ;out= fopen (“outdat“,“w“);for(i = 0 ; i 10 ; i+) (fscanf (in, “, s);fun (s);fprintf (out, “sn“, s) ;fclose (in);fclose (out);

展开阅读全文
相关资源
猜你喜欢
  • DIN EN 1062-1-2004 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 1 Classification German version EN 1062-1 2004《色漆和清漆 外部砖石和混.pdf DIN EN 1062-1-2004 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 1 Classification German version EN 1062-1 2004《色漆和清漆 外部砖石和混.pdf
  • DIN EN 1062-11 Berichtigung 1-2005 de 7894 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 11 Methods of conditioning before t.pdf DIN EN 1062-11 Berichtigung 1-2005 de 7894 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 11 Methods of conditioning before t.pdf
  • DIN EN 1062-11-2002 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 11 Methods of conditioning before testing German version E.pdf DIN EN 1062-11-2002 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 11 Methods of conditioning before testing German version E.pdf
  • DIN EN 1062-3-2008 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 3 Determination of liquid water permeability English versio.pdf DIN EN 1062-3-2008 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 3 Determination of liquid water permeability English versio.pdf
  • DIN EN 1062-6-2002 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 6 Determination of carbon dioxide permeability German versi.pdf DIN EN 1062-6-2002 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 6 Determination of carbon dioxide permeability German versi.pdf
  • DIN EN 1062-7-2004 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 7 Determination of crack bridging properties German version.pdf DIN EN 1062-7-2004 Paints and varnishes - Coating materials and coating systems for exterior masonry and concrete - Part 7 Determination of crack bridging properties German version.pdf
  • DIN EN 1063-2000 Glass in building - Security glazing - Testing and classification of resistance against bullet attack German version EN 1063 1999《建筑物玻璃 安全玻璃 防弹玻璃试验和分类》.pdf DIN EN 1063-2000 Glass in building - Security glazing - Testing and classification of resistance against bullet attack German version EN 1063 1999《建筑物玻璃 安全玻璃 防弹玻璃试验和分类》.pdf
  • DIN EN 1064-2007 Health informatics - Standard communication protocol - Computer-assisted electrocardiography English version EN 1064 2005+A1 2007《健康信息学 标准通信协议 计算机辅助心电图仪》.pdf DIN EN 1064-2007 Health informatics - Standard communication protocol - Computer-assisted electrocardiography English version EN 1064 2005+A1 2007《健康信息学 标准通信协议 计算机辅助心电图仪》.pdf
  • DIN EN 1065-1998 Adjustable telescopic steel props - Product specifications design and assessment by calculation and tests German version EN 1065 1998《可拉伸调节的钢结构支撑件 产品规范 通过计算和试验进行设计.pdf DIN EN 1065-1998 Adjustable telescopic steel props - Product specifications design and assessment by calculation and tests German version EN 1065 1998《可拉伸调节的钢结构支撑件 产品规范 通过计算和试验进行设计.pdf
  • 相关搜索
    资源标签

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1