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

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

1、国家二级 C 语言机试(操作题)模拟试卷 360(无答案)一、程序填空题1 人员的记录由编号和出生年、月、日组成,N 名人员的数据已在主函数中存入结构体数组 std 中。函数 fun 的功能是:找出指定出生年份的人员,将其数据放在形参 k 所指的数组中,由主函数输出,同时由函数值返回满足指定条件的人数。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANK1C 中。不得增行或删行,也不得更改程序的结构!#include #define N 8typedef struct int num;int year,month,day STU;i

2、nt fun (STU *std, STU *k, int year) int i,n=0;if(_1_ =year)return (_3_);main ()STU std N= 1,1984,2,15 ,2,1983, 9,21, 3,1984,9,1 ,4,1983 ,7 ,15 ,5,1985,9,28 , 6,1982,11,15 ,7, 1982,6,22,8 ,1984f 8,19 ;STU kN; int i,n,year;printf(“Enter a year : “); scanfn=fun (std,k,year) ;printf(“nNo person was born

3、in d n“,year);else printf(“nThese persons wereborn in d n“ ,year);printf(“d dddn“ ,k i num,k i year, ki month,kiday) ;二、程序修改题2 给定程序 MODI1C 的功能是:读入一个整数 k(2k10000),打印它的所有质因子(即所有为素数的因子)。例如,若输入整数:2310,则应输出:2、3、5、7,11。请改正程序中的语法错误,使程序能得出正确的结果。注意:不要改动 main 函数,不得增行或删行,也不得更改程序的结构!#include IsPrime (int n) ; i

4、nt i,m;m = 1;if ! (n i) m =0; break ;return (m) ;main () int j,k;printf ( “nPlease enter an integernumber between 2 and 10000: “);scanf(“ d“,k);printf(“nnThe prime factor(s)of d iS (are) :“, k) ;printf(“n 4d“,j) ;printf (“n“) ;三、程序设计题3 己知学生的记录由学号和学习成绩构成,N 名学生的数据已存入结构体数组 a 中。请编写函数 fun,函数的功能是:找出成绩最高的学

5、生记录,通过形参指针传回主函数(规定只有一个最高分)。已给出函数的首部,请完成该函数。注意:部分源程序存在文件 PROG1C 中。请勿改动主函数 mam 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。#include #include #define N 10typedef struct ss char num10; int s; STU;fun(STU a, STU *s)main () “A06“,90 , “A07“,79J , “A08“,61 ,int i;printf(“* The original data*n“);for (i=0; 1 N; i+)printf(“No= s Mark = dn“,printf (“The top : s , dn“,mnum,ms);NONO () :NONO ()FILE *rf,*wf ;STU aN,m ;int i ;rf = fopen (“indat“ ,“r“) ;wf= fopen “outdat“,“w“) ;for (i = 0 ; i 10; 1+) fscanf (rf ,“ s d“, ai num &a i s) ;fprintf (wf, “The top : s, dn“,mnum, m s) ;fclose (rf)fclose (wf)

展开阅读全文
相关资源
猜你喜欢
  • GOST R ISO 8422-2011 Statistical methods Sequential sampling plans for inspection by attributes《统计方法 属性检测用序列抽样方案》.pdf GOST R ISO 8422-2011 Statistical methods Sequential sampling plans for inspection by attributes《统计方法 属性检测用序列抽样方案》.pdf
  • GOST R ISO 8423-2011 Statistical methods Sequential sampling plans for inspection by variables for percent nonconforming (known standard deviation)《统计方法 通过不符合百分率变量检测的序列抽样法(标准偏差已知)》.pdf GOST R ISO 8423-2011 Statistical methods Sequential sampling plans for inspection by variables for percent nonconforming (known standard deviation)《统计方法 通过不符合百分率变量检测的序列抽样法(标准偏差已知)》.pdf
  • GOST R ISO 8471-1998 Information processing systems Data communications High-level data link control balanced classes of procedures Data-link layer address resolution negotiation i.pdf GOST R ISO 8471-1998 Information processing systems Data communications High-level data link control balanced classes of procedures Data-link layer address resolution negotiation i.pdf
  • GOST R ISO 8482-1993 Information processing systems Data communication Twisted pair multipoint interconnections《信息处理系统 数据通信 双绞线多点连接》.pdf GOST R ISO 8482-1993 Information processing systems Data communication Twisted pair multipoint interconnections《信息处理系统 数据通信 双绞线多点连接》.pdf
  • GOST R ISO 8489-1-1993 Textile machinery and accessories Canes for cross woundwinding Dimensions《纺织机械和配件 交互绕组杆 尺寸规格》.pdf GOST R ISO 8489-1-1993 Textile machinery and accessories Canes for cross woundwinding Dimensions《纺织机械和配件 交互绕组杆 尺寸规格》.pdf
  • GOST R ISO 8501-1-2014 Preparation of steel substrates before application of paints and related products Visual assessment of surface cleanliness Part 1 Rust grades and preparationteel.pdf GOST R ISO 8501-1-2014 Preparation of steel substrates before application of paints and related products Visual assessment of surface cleanliness Part 1 Rust grades and preparationteel.pdf
  • GOST R ISO 8543-2011 Textile floor coverings Methods for determination of mass《纺织地毯 质量的测定方法》.pdf GOST R ISO 8543-2011 Textile floor coverings Methods for determination of mass《纺织地毯 质量的测定方法》.pdf
  • GOST R ISO 8548-2-2011 Prosthetics and orthotics Limb deficiencies Part 2 Method of describing lower limb amputation stumps《修复术和矫形学 肢缺陷 第2部分 下肢截肢残端的描述方法》.pdf GOST R ISO 8548-2-2011 Prosthetics and orthotics Limb deficiencies Part 2 Method of describing lower limb amputation stumps《修复术和矫形学 肢缺陷 第2部分 下肢截肢残端的描述方法》.pdf
  • GOST R ISO 8548-4-2011 Prosthetics and orthotics Limb deficiencies Part 4 Description of causal conditions leading to amputation《修复术和矫形学 肢缺陷 第4部分 导致截肢的原因描述》.pdf GOST R ISO 8548-4-2011 Prosthetics and orthotics Limb deficiencies Part 4 Description of causal conditions leading to amputation《修复术和矫形学 肢缺陷 第4部分 导致截肢的原因描述》.pdf
  • 相关搜索
    资源标签

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

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