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

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

1、国家二级 C 语言机试(操作题)模拟试卷 369(无答案)一、程序填空题1 给定程序中,函数 fun 的功能是:对形参 ss 所指字符串数组中的 M 个字符串按长度由短到长进行排序。SS 所指字符串数组中共有 M 个字符串,且串长#include #define M 5#define N 20void fun (char (*ss) N ) int i,j,k,nM; char tN ;for (i=0; in j) _2_ ; strcpy (t,ss i) ;strcpy (ss i ,ss k ) ;strcpy (ss k,_3_) ;main ( ) char ss M IN=“sh

2、anghai“,“guangzhou“, “beijing“ “tianjing“,“cchongqing“ ;int i;printf(“nThe original strings are :n“);for(i=0; i#include /*found*/void fun (char str, char ch) while (*str & *str !=ch) str+;/*found*/if (*str= ch) str 0 = ch;/*found*/ str 1 = ch;main () char s81,c ;printf ( “nPlease enter a string:prin

3、tf (“n Please enter thecharacter to search : “);c =getchar();fun (s, c) ;printf (“nThe result is sn“ ,s) ;三、程序设计题3 请编一个函数 fun(char *s),函数的功能是把 s 所指字符串中的内容逆置。例如:字符串中原有的字符串为:abcdefg,则调用该函数后,串中的内容为:gfedcba。注意:部分源程序存在文件 PROG1C 中。请勿改动主函数 mam 和其他函数中的任何内容,仅在函数 fun 的花括号中填入你编写的若干语句。#include #include #define

4、N 81fun (char *s)NONO()/*请在此函数内打开文件,输入测试数据,调用 fun 函数,输出数据,关闭文件。*/int i ;char aN ;FILE *rf,*wf ;rf = fopen (“indat“ ,“r“) ;wf = fopen (“outdat“, “w“) ;fscanf (rf, “ s“, a) ;fun (a) ;fprintf (wf, “ sn“ , a) ;fclose (rf) ;fclose (wf) ;main () char a N ;printf (“Enter a string:“);gets(a) ;printf (“The original string is :fun (a);printf (“n“) ;printf (“The string aftermodified : “) ;puts (a);NONO () ;

展开阅读全文
相关资源
猜你喜欢
  • BS DD CEN TS 13130-28-2005 Materials and articles in contact with foodstuffs - Plastics substances subject to limitation - Determination of 1 1 1-trimethylopropane in food simulant.pdf BS DD CEN TS 13130-28-2005 Materials and articles in contact with foodstuffs - Plastics substances subject to limitation - Determination of 1 1 1-trimethylopropane in food simulant.pdf
  • BS DD CEN TS 13130-9-2005 Materials and articles in contact with foodstuffs - Plastics substances subject to limitation - Determination of acetic acid vinyl ester in food simulants.pdf BS DD CEN TS 13130-9-2005 Materials and articles in contact with foodstuffs - Plastics substances subject to limitation - Determination of acetic acid vinyl ester in food simulants.pdf
  • BS DD CEN TS 13149-3-2007 Public transport - Road vehicle scheduling and control systems - WorldFIP message content《公共运输 道路车辆行程安排和控制系统 WorldFIP文电内容》.pdf BS DD CEN TS 13149-3-2007 Public transport - Road vehicle scheduling and control systems - WorldFIP message content《公共运输 道路车辆行程安排和控制系统 WorldFIP文电内容》.pdf
  • BS DD CEN TS 13149-6-2005 Public transport — Road vehicle scheduling and control systems — Part 6 CAN message content《公共运输 道路车辆调度和控制系统 CAN文电内容》.pdf BS DD CEN TS 13149-6-2005 Public transport — Road vehicle scheduling and control systems — Part 6 CAN message content《公共运输 道路车辆调度和控制系统 CAN文电内容》.pdf
  • BS DD CEN TS 13307-2-2009 Laminated and finger jointed timber blanks and semi-finished profiles for non-structural uses - Production control《非结构用层压和指形接合的木材坯件和半成品 产品控制》.pdf BS DD CEN TS 13307-2-2009 Laminated and finger jointed timber blanks and semi-finished profiles for non-structural uses - Production control《非结构用层压和指形接合的木材坯件和半成品 产品控制》.pdf
  • BS DD CEN TS 13476-4-2008 Plastics piping systems for non-pressure underground drainage and sewerage - Structured-wall piping systems of unplasticized poly(vinyl chloride) (PVC-U) .pdf BS DD CEN TS 13476-4-2008 Plastics piping systems for non-pressure underground drainage and sewerage - Structured-wall piping systems of unplasticized poly(vinyl chloride) (PVC-U) .pdf
  • BS DD CEN TS 13763-27-2003 Explosives for civil uses Detonators and relays Definitions methods and requirements for electronic initiation systems《民用爆炸物 起爆管和传爆药 电子起爆系统的定义、方法和要求》.pdf BS DD CEN TS 13763-27-2003 Explosives for civil uses Detonators and relays Definitions methods and requirements for electronic initiation systems《民用爆炸物 起爆管和传爆药 电子起爆系统的定义、方法和要求》.pdf
  • BS DD CEN TS 13778-2005 Mobile demolition machinery - Safety requirements《移动式拆除机械 安全要求》.pdf BS DD CEN TS 13778-2005 Mobile demolition machinery - Safety requirements《移动式拆除机械 安全要求》.pdf
  • BS DD CEN TS 13810-2-2003 Wood-based panels Floating floors Test methods《木质板材 架空地板 试验方法》.pdf BS DD CEN TS 13810-2-2003 Wood-based panels Floating floors Test methods《木质板材 架空地板 试验方法》.pdf
  • 相关搜索

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

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