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

展开阅读全文
相关资源
猜你喜欢
  • BS EN 13286-1-2003 Unbound and hydraulically bound mixtures - Test methods for laboratory reference density and water content - Introduction general requirements and sampling《松散的和液.pdf BS EN 13286-1-2003 Unbound and hydraulically bound mixtures - Test methods for laboratory reference density and water content - Introduction general requirements and sampling《松散的和液.pdf
  • BS EN 13286-2-2010 Unbound and hydraulically bound mixtures Test methods for laboratory reference density and water content Proctor compaction《松散的和液力粘合的混合料 实验室参考密度和水含量测定的试验方法 普氏击实试.pdf BS EN 13286-2-2010 Unbound and hydraulically bound mixtures Test methods for laboratory reference density and water content Proctor compaction《松散的和液力粘合的混合料 实验室参考密度和水含量测定的试验方法 普氏击实试.pdf
  • BS EN 13286-3-2003 Unbound and hydraulically bound mixtures - Test methods for laboratory reference density and water content - Vibrocompression with controlled parameters《松散的和液压粘合.pdf BS EN 13286-3-2003 Unbound and hydraulically bound mixtures - Test methods for laboratory reference density and water content - Vibrocompression with controlled parameters《松散的和液压粘合.pdf
  • BS EN 13286-4-2003 Unbound and hydraulically bound mixtures - Test methods for laboratory reference density and water content - Vibrating hammer《松散的和液压粘合的混合料 实验室参考密度和水含量的测试方法 振动锤》.pdf BS EN 13286-4-2003 Unbound and hydraulically bound mixtures - Test methods for laboratory reference density and water content - Vibrating hammer《松散的和液压粘合的混合料 实验室参考密度和水含量的测试方法 振动锤》.pdf
  • BS EN 13286-40-2003 Unbound and hydraulically bound mixtures - Test method for determination of the direct tensile strength of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘合混合料直接.pdf BS EN 13286-40-2003 Unbound and hydraulically bound mixtures - Test method for determination of the direct tensile strength of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘合混合料直接.pdf
  • BS EN 13286-41-2003 Unbound and hydraulically bound mixtures - Test method for determination of the compressive strength of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘合混合料抗压强度的.pdf BS EN 13286-41-2003 Unbound and hydraulically bound mixtures - Test method for determination of the compressive strength of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘合混合料抗压强度的.pdf
  • BS EN 13286-42-2003 Unbound and hydraulically bound mixtures - Test method for the determination of the indirect tensile strength of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘.pdf BS EN 13286-42-2003 Unbound and hydraulically bound mixtures - Test method for the determination of the indirect tensile strength of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘.pdf
  • BS EN 13286-43-2003 Unbound and hydraulically bound mixtures Test method for the determination of the modulus of elasticity of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘合混合料弹性.pdf BS EN 13286-43-2003 Unbound and hydraulically bound mixtures Test method for the determination of the modulus of elasticity of hydraulically bound mixtures《松散的和液压粘合的混合料 测定液压粘合混合料弹性.pdf
  • BS EN 13286-44-2003 Unbound and hydraulically bound mixtures - Test method for the determination of the alpha coefficient of vitrified blast furnace slag《松散的和液力粘合的混合料 玻璃质高炉矿渣的α系数测定.pdf BS EN 13286-44-2003 Unbound and hydraulically bound mixtures - Test method for the determination of the alpha coefficient of vitrified blast furnace slag《松散的和液力粘合的混合料 玻璃质高炉矿渣的α系数测定.pdf
  • 相关搜索
    资源标签

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

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