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

展开阅读全文
相关资源
猜你喜欢
  • BS EN 12131-1998 Feather and down - Test methods - Determination of the quantitive composition of feather and down (manual method)《羽毛和羽绒 试验方法 羽毛和羽绒组分的定量测定(人工法)》.pdf BS EN 12131-1998 Feather and down - Test methods - Determination of the quantitive composition of feather and down (manual method)《羽毛和羽绒 试验方法 羽毛和羽绒组分的定量测定(人工法)》.pdf
  • BS EN 12132-1-1999 Feather and down - Methods of testing the down-proof properties of fabrics - Rubbing test《羽毛和羽绒 纤维羽绒特性的试验方法 摩擦试验》.pdf BS EN 12132-1-1999 Feather and down - Methods of testing the down-proof properties of fabrics - Rubbing test《羽毛和羽绒 纤维羽绒特性的试验方法 摩擦试验》.pdf
  • BS EN 12132-2-1999 Feather and down - Methods of testing the down-proof properties of fabrics - Impact test《羽毛和羽绒 纤维羽绒特性的试验方法 冲击试验》.pdf BS EN 12132-2-1999 Feather and down - Methods of testing the down-proof properties of fabrics - Impact test《羽毛和羽绒 纤维羽绒特性的试验方法 冲击试验》.pdf
  • BS EN 12133-1998 Fruit and vegetable juices - Determination of chloride content - Potentiometric titration method《水果和蔬菜汁 氯化物含量的测定 电位滴定法》.pdf BS EN 12133-1998 Fruit and vegetable juices - Determination of chloride content - Potentiometric titration method《水果和蔬菜汁 氯化物含量的测定 电位滴定法》.pdf
  • BS EN 12134-1998 Fruit and vegetable juices - Determination of centrifugable pulp content《水果和蔬菜汁 可离心分离的果肉含量的测定》.pdf BS EN 12134-1998 Fruit and vegetable juices - Determination of centrifugable pulp content《水果和蔬菜汁 可离心分离的果肉含量的测定》.pdf
  • BS EN 12135-1998 Fruit and vegetable juices - Determination of nitrogen content - Kjeldahl method《水果和蔬菜汁 氮含量的测定 基耶达斯法》.pdf BS EN 12135-1998 Fruit and vegetable juices - Determination of nitrogen content - Kjeldahl method《水果和蔬菜汁 氮含量的测定 基耶达斯法》.pdf
  • BS EN 12136-1998 Fruit and vegetable juices - Determination of total carotenoid content and individual carotenoid fractions《水果汁和蔬菜汁 总类胡萝卜素含量及各分类胡萝卜素比例的测定 》.pdf BS EN 12136-1998 Fruit and vegetable juices - Determination of total carotenoid content and individual carotenoid fractions《水果汁和蔬菜汁 总类胡萝卜素含量及各分类胡萝卜素比例的测定 》.pdf
  • BS EN 12137-1998 Fruit and vegetable juices - Determination of tartaric acid in grape juices - Method by high performance liquid chromatography《水果汁和蔬菜汁 葡萄汁中酒石酸测定 高性能液相色谱法》.pdf BS EN 12137-1998 Fruit and vegetable juices - Determination of tartaric acid in grape juices - Method by high performance liquid chromatography《水果汁和蔬菜汁 葡萄汁中酒石酸测定 高性能液相色谱法》.pdf
  • BS EN 12138-1998 Fruit and vegetable juices - Enzymatic determination of D-malic acid content - NAD spectrometric method《水果汁和蔬菜汁 D-苹果酸含量的酶测定 NAD分光光度方法》.pdf BS EN 12138-1998 Fruit and vegetable juices - Enzymatic determination of D-malic acid content - NAD spectrometric method《水果汁和蔬菜汁 D-苹果酸含量的酶测定 NAD分光光度方法》.pdf
  • 相关搜索

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

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