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

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

1、国家二级 C 语言机试(操作题)模拟试卷 351(无答案)一、程序填空题1 给定程序中,函数 fun 的功能是:将形参 n 中,各位上为偶数的数取出,并按原来从高位到低位的顺序组成一个新的数,并作为函数值返回。例如,从主函数输入一个整数:27638496,函数返回值为:26846。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的 BLANK1C 中。不得增行或删行,也不得更改程序的结构!#include unsigned long fun (unsigned long n) unsigned long x=0,s,i; int t;s=n;

2、1=_1_ ;while ( _2_ )if (t2=0) s=s/10;return x;main () unsigned long n=1;while (n99999999 |n#define M 5int fun(int nr int xx ) int i,j,sum=0 ;printf(“nThe d x d matrix:n“,printf (“n“) ;sum += xx i i+xx i nil ;return (sum) ;main () int aaM M= 1,2, 3,4,5 ,4,3, 2,1 ,0 , 6,7,8,9,0,t 9,8,7,6,5,printf (“nT

3、he sum of all elementson 2 diagnals is d“ ,fun (M, aa) ;三、程序设计题3 函数 fun 的功能是:将 a、b 中的两个两位正整数合并形成一个新的整数放在 c中。合并的方式是:将 a 中的十位和个位数依次放在变量 c 的千位和十位上,b 中的十位和个位数依次放在变量 c 的个位和百位上。例如,当 a=45,b=12。调用该函数后,c=4251。注意:部分源程序存在文件 PROG1C 中。数据文件 INDAT 中的数据不得修改。请勿改动主函数 mam 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。#include

4、void fun (int a, int b, long *c)void NONO ()/*本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。 */FILE *rfr *wf ;int i,a,b ; long C ;rf= fopen (“indat“ ,“r“);wf = fopen (“outdat“, “w“);for(i=0 ; i 10 ; i+) fscanf (rf, “ d,d“ , &a , &b);fun (a, b, &c);fprintf (wf, “a=d,b=d,C=ldn“,a,b,c);fclose (rf);fclose (wf);main()int a, b; long c;voici NONO ();printf(“Input a, b:“);scanf(“dd“, &a , &b);fun (af b, &c);printf( “The result is: ooldn“,c);NONO();

展开阅读全文
相关资源
猜你喜欢
  • ETSI TS 121 101-2018 Universal Mobile Telecommunications System (UMTS) Technical Specifications and Technical Reports for a UTRAN-based 3GPP system (V15 0 0 3GPP TS 21 101 version .pdf ETSI TS 121 101-2018 Universal Mobile Telecommunications System (UMTS) Technical Specifications and Technical Reports for a UTRAN-based 3GPP system (V15 0 0 3GPP TS 21 101 version .pdf
  • ETSI TS 121 102-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 4 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第4次发布)规范 3GPP TS 21 102(版本4 8 0 .pdf ETSI TS 121 102-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 4 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第4次发布)规范 3GPP TS 21 102(版本4 8 0 .pdf
  • ETSI TS 121 102-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 4 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第4次发布)规范 3GPP TS 21 102(版本4 8 0 _1.pdf ETSI TS 121 102-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 4 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第4次发布)规范 3GPP TS 21 102(版本4 8 0 _1.pdf
  • ETSI TS 121 103-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 5 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第5次发布)规范 3GPP TS 21 103(版本5 3 0 .pdf ETSI TS 121 103-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 5 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第5次发布)规范 3GPP TS 21 103(版本5 3 0 .pdf
  • ETSI TS 121 103-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 5 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第5次发布)规范 3GPP TS 21 103(版本5 3 0 _1.pdf ETSI TS 121 103-2003 Universal Mobile Telecommunications System (UMTS) 3rd Generation Mobile System Release 5 Specifications《全球移动通信系统(UMTS) 第3代移动系统(第5次发布)规范 3GPP TS 21 103(版本5 3 0 _1.pdf
  • ETSI TS 121 111-2016 Universal Mobile Telecommunications System (UMTS) LTE USIM and IC card requirements (V13 0 0 3GPP TS 21 111 version 13 0 0 Release 13)《通用移动通信系统(UMTS) 长期演进技术(LT.pdf ETSI TS 121 111-2016 Universal Mobile Telecommunications System (UMTS) LTE USIM and IC card requirements (V13 0 0 3GPP TS 21 111 version 13 0 0 Release 13)《通用移动通信系统(UMTS) 长期演进技术(LT.pdf
  • ETSI TS 121 111-2017 Universal Mobile Telecommunications System (UMTS) LTE USIM and IC card requirements (V14 1 0 3GPP TS 21 111 version 14 1 0 Release 14).pdf ETSI TS 121 111-2017 Universal Mobile Telecommunications System (UMTS) LTE USIM and IC card requirements (V14 1 0 3GPP TS 21 111 version 14 1 0 Release 14).pdf
  • ETSI TS 121 111-2018 Universal Mobile Telecommunications System (UMTS) LTE USIM and IC card requirements (V15 1 1 3GPP TS 21 111 version 15 1 1 Release 15).pdf ETSI TS 121 111-2018 Universal Mobile Telecommunications System (UMTS) LTE USIM and IC card requirements (V15 1 1 3GPP TS 21 111 version 15 1 1 Release 15).pdf
  • ETSI TS 121 133-2001 Universal Mobile Telecommunications System (UMTS) 3G Security Security Threats and Requirements (3G TS 21 133 Version 3 2 0 Release 1999)《全球移动通信系统(UMTS) 3G安全 安.pdf ETSI TS 121 133-2001 Universal Mobile Telecommunications System (UMTS) 3G Security Security Threats and Requirements (3G TS 21 133 Version 3 2 0 Release 1999)《全球移动通信系统(UMTS) 3G安全 安.pdf
  • 相关搜索

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

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