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

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

1、国家二级 C 语言机试(操作题)模拟试卷 339(无答案)一、程序填空题1 给定程序中,函数 fun 的功能是:求 SS 所指字符串数组中长度最短的字符串所在的行下标,作为函数值返回,并把其串长放在形参 n 所指变量中。SS 所指字符串数组中共有 M 个字符串,且串长#include #define M 5#define N 20int fun (char (*ss) N, int *n) int i,k=0,len= N; len=strlen (ss i ) ;if (i=0) *n=len;if (len _2_ *n)k=i;return (_ 3 _);main () char ss

2、M N=“shanghai“,“ guangzhou “ ,“beij ing“ , “ tian j ing“ ,“chongqing“ ;int n,k,i;printf(“nThe original stringsfor (i=0;i#include char* fun (char tt )int i;for (i = 0; tt i; i+)tt i += 32;return (tt) ;main ()char tt 81 ;printf (“nPlease enter a string:“) ;gets (tt) ;printf(“nThe result string is:nsrt

3、 fun (tt) ;三、程序设计题3 请编写函数 fun,其功能是:将所有大于 1 小于整数 m 的非素数存入 xx 所指数组中,非素数的个数通过 k 传回。例如,若输入:17,则应输出:4 6 8 9 10 12 14 15 16。注意:部分源程序在文件 PROG1C 中。请勿改动主函数 mam 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。#include void fun(int m int *k,int xx)main()int m,n,zz100;void NONO ();printf (“nPlease enter an integernumber b

4、etween 10 and 100: “);scanf(“d“, &n);fun (n, &m, zz) ;printf( “nnThere are d nonprime numbers less than d:“,m n) ;for(n=0 ; nm; n+)printf( “n 4d“, zz n) ;NONO();void NONO()/*请在此函数内打开文件,输入测试数据,调用 fun 函数,输出数据,关闭文件。 */int m, n zz 100 ;FILE *rf, kwf ,rf = fopen( “indat“ ,“r“);wf=fopen (“outdat“, “w“);fscanf (rf, “ d“, &n) ;fun (n, &m, zz) ;fprintf(wf, “dndn“,mr n)fprintf (wf, “ dn“, zz n ) ;fclose (rf) ;fclose (wf) ;

展开阅读全文
相关资源
猜你喜欢
  • DIN EN 3973-2007 Aerospace series - Steel FE-CM3801 (X5CrNiCuNb16-4) - Homogenized solution treated and precipitation hardened - Investment casting - D 50 mm - R 1030 MPa German an.pdf DIN EN 3973-2007 Aerospace series - Steel FE-CM3801 (X5CrNiCuNb16-4) - Homogenized solution treated and precipitation hardened - Investment casting - D 50 mm - R 1030 MPa German an.pdf
  • DIN EN 3976-2007 Aerospace series - Titanium and titanium alloys - Test method - Chemical analysis for the determination of hydrogen content German and English version EN 3976 2006.pdf DIN EN 3976-2007 Aerospace series - Titanium and titanium alloys - Test method - Chemical analysis for the determination of hydrogen content German and English version EN 3976 2006.pdf
  • DIN EN 3979-2006 Aerospace series - Aluminium alloy AL-P8090-O2 - Sheet for superplastic forming (SPF) - 0 8 mm a 6 mm German and English version EN 3979 2005《航空航天系列 铝合金AL-P8090-O2.pdf DIN EN 3979-2006 Aerospace series - Aluminium alloy AL-P8090-O2 - Sheet for superplastic forming (SPF) - 0 8 mm a 6 mm German and English version EN 3979 2005《航空航天系列 铝合金AL-P8090-O2.pdf
  • DIN EN 3982-2016 Aerospace series - Aluminium alloy AL-P7050 - AlZn6CuMgZr - T7451 - Plates - 6 mm a = 160 mm German and English version EN 3982 2015《航空航天系列 AL-P7050型铝合金 AlZn6CuMgZ.pdf DIN EN 3982-2016 Aerospace series - Aluminium alloy AL-P7050 - AlZn6CuMgZr - T7451 - Plates - 6 mm a = 160 mm German and English version EN 3982 2015《航空航天系列 AL-P7050型铝合金 AlZn6CuMgZ.pdf
  • DIN EN 3983-2014 Aerospace series - Aluminium alloy AL-P7050 - T7651 - Plate - 6 mm a = 160 mm German and English version EN 3983 2013《航空航天系列 AL-P7050铝合金 T7651 板材 6 mm≤a≤160 mm 德文和.pdf DIN EN 3983-2014 Aerospace series - Aluminium alloy AL-P7050 - T7651 - Plate - 6 mm a = 160 mm German and English version EN 3983 2013《航空航天系列 AL-P7050铝合金 T7651 板材 6 mm≤a≤160 mm 德文和.pdf
  • DIN EN 3987-2010 Aerospace series - Test methods for metallic materials - Constant amplitude force-controlled high cycle fatigue testing German and English version EN 3987 2009《航空航.pdf DIN EN 3987-2010 Aerospace series - Test methods for metallic materials - Constant amplitude force-controlled high cycle fatigue testing German and English version EN 3987 2009《航空航.pdf
  • DIN EN 3997-2016 de en 7745 Aerospace series - Aluminium alloy AL-P2024 - Al Cu4Mg1 - T3 - Sheet and strip - 0 4 mm = a = 6 mm German and English version EN 3997 2015《航空航天系列 AL-P20.pdf DIN EN 3997-2016 de en 7745 Aerospace series - Aluminium alloy AL-P2024 - Al Cu4Mg1 - T3 - Sheet and strip - 0 4 mm = a = 6 mm German and English version EN 3997 2015《航空航天系列 AL-P20.pdf
  • DIN EN 3998-2007 Aerospace series - Aluminium alloy AL-P2024-T4 or T42 - Sheet and strip 0 3 mm ≤ a ≤ 6 mm German and English version EN 3998 2007《航空航天系列 AL-P2024-T4或T42型铝合金 0 3mm≤.pdf DIN EN 3998-2007 Aerospace series - Aluminium alloy AL-P2024-T4 or T42 - Sheet and strip 0 3 mm ≤ a ≤ 6 mm German and English version EN 3998 2007《航空航天系列 AL-P2024-T4或T42型铝合金 0 3mm≤.pdf
  • DIN EN 3999-2007 Aerospace series - Aluminium alloy AL-P2024-T351 - Sheet and strip with improved chemical milling capability 1 6 mm ≤ a ≤ 6 mm German and English version EN 3999 2.pdf DIN EN 3999-2007 Aerospace series - Aluminium alloy AL-P2024-T351 - Sheet and strip with improved chemical milling capability 1 6 mm ≤ a ≤ 6 mm German and English version EN 3999 2.pdf
  • 相关搜索
    资源标签

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

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