[计算机类试卷]国家二级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);

展开阅读全文
相关资源
猜你喜欢
  • KS T ISO 3205-2006 Continuous mechanical handling equipment for loose bulk materials-Wagon tipplers handling rail-borne wagons(rotary side discharge and end discharge)-Safety code《.pdf KS T ISO 3205-2006 Continuous mechanical handling equipment for loose bulk materials-Wagon tipplers handling rail-borne wagons(rotary side discharge and end discharge)-Safety code《.pdf
  • KS T ISO 3284-2006 Continuous mechanical handling equipment for loose bulk materials-Dimensions of bends for use in pneumatic handling《松散物料连续搬运设备 气力输送用弯管尺寸》.pdf KS T ISO 3284-2006 Continuous mechanical handling equipment for loose bulk materials-Dimensions of bends for use in pneumatic handling《松散物料连续搬运设备 气力输送用弯管尺寸》.pdf
  • KS T ISO 3435-2006 Continuous mechanical handling equipment-Classification and symbolization of bulk materials《连续搬运设备 散状物料的分类和符号表示》.pdf KS T ISO 3435-2006 Continuous mechanical handling equipment-Classification and symbolization of bulk materials《连续搬运设备 散状物料的分类和符号表示》.pdf
  • KS T ISO 3569-2006 Continuous mechanical handling equipment-Classification of unit loads《连续搬运设备 成件货物的分类》.pdf KS T ISO 3569-2006 Continuous mechanical handling equipment-Classification of unit loads《连续搬运设备 成件货物的分类》.pdf
  • KS T ISO 5031-2006 Continuous mechanical handling equipment for loose bulk materials-Couplings and hose components used in pneumatic handling-Safety code《松散物料连续搬运设备 气力输送用接头和软管 安全规则.pdf KS T ISO 5031-2006 Continuous mechanical handling equipment for loose bulk materials-Couplings and hose components used in pneumatic handling-Safety code《松散物料连续搬运设备 气力输送用接头和软管 安全规则.pdf
  • KS T ISO 5048-2003 Continuous mechanical handling equipment-Belt conveyors with carrying idlers-Calculation of operating power and tensile forces《连续搬运设备 带承载托辊的带式输送机 运行功率和张力的计算》.pdf KS T ISO 5048-2003 Continuous mechanical handling equipment-Belt conveyors with carrying idlers-Calculation of operating power and tensile forces《连续搬运设备 带承载托辊的带式输送机 运行功率和张力的计算》.pdf
  • KS T ISO 5050-2006 Continuous mechanical handling equipment-Vertical bucket elevators with calibrated round steel link chains- General characteristics《连续搬运设备 校准圆环链垂直斗式提升机 一般特性》.pdf KS T ISO 5050-2006 Continuous mechanical handling equipment-Vertical bucket elevators with calibrated round steel link chains- General characteristics《连续搬运设备 校准圆环链垂直斗式提升机 一般特性》.pdf
  • KS T ISO 5051-2006 Continuous mechanical handling equipment-Deep elevator bucket with flat rear wall-Main dimensions《连续搬运设备 斗式提升机的平后壁深料斗 主要尺寸》.pdf KS T ISO 5051-2006 Continuous mechanical handling equipment-Deep elevator bucket with flat rear wall-Main dimensions《连续搬运设备 斗式提升机的平后壁深料斗 主要尺寸》.pdf
  • KS T ISO 6590-2-2002 Vocabulary and types used in sacks made from thermoplastic flexible film《热塑柔性薄膜袋的术语与形式》.pdf KS T ISO 6590-2-2002 Vocabulary and types used in sacks made from thermoplastic flexible film《热塑柔性薄膜袋的术语与形式》.pdf
  • 相关搜索
    资源标签

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

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