首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列给定程序的功能是:读入一个英文文本行,将其中每个单词的第一个字母改成大写,然后输出此文本行(这里”单词”是指由空格隔开的字符串)。例如,若输入"I am a student to takethe examination",则应输出"I Am A Stu
下列给定程序的功能是:读入一个英文文本行,将其中每个单词的第一个字母改成大写,然后输出此文本行(这里”单词”是指由空格隔开的字符串)。例如,若输入"I am a student to takethe examination",则应输出"I Am A Stu
admin
2020-10-26
19
问题
下列给定程序的功能是:读入一个英文文本行,将其中每个单词的第一个字母改成大写,然后输出此文本行(这里”单词”是指由空格隔开的字符串)。例如,若输入"I am a student to takethe examination",则应输出"I Am A Student To TakeThe Examination"。
请改正程序中的错误,使程序能得出正确的结果。
注意:部分源程序在文件MODI1.C中,不要改动main函数,不得增行或删行,也不得更改程序的结构!
试题程序:
1 #include<stdlib.h>
2 #include<string.h>
3 #include<conio.h>
4 #include<ctype.h>
5 #include<stdio.h>
6 #include<string.h>
7 /*********found*********/
8 void upfst(char P)
9 {
10 int k=0;
11 for(;*P;P++)
12 if(k)
13 {
14 if(*P==’’)
15 k=0;
16 }
17 else
18 {
19 if(*P!=’’)
20 {
21 k=1;
22 *P=toupper(*P);
23 }
24 }
25 }
26 void main()
27 {
28 char chrstr[81]j
29 System("CLS");
30 printf("\nPlease enter an English text;lihe:");
31 gets(chrstr);
32 printf("\nBofore changing:\n%s",chrstr);
33 upfst(chrstr);
34 printf("\nAfter changing:\n%s\n",chrstr);
35 }
选项
答案
void upfst(char*p)
解析
主函数中fun函数的调用方式说明函数fun的参数应为指针类型。
转载请注明原文地址:https://kaotiyun.com/show/Ot3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
关于程序中的注释,以下叙述正确的是()。
以下关于retum语句的叙述中正确的是()。【10年3月】
下列选项中不属于面向对象程序设计特征的是()。【07年4月】
下列定义变量的语句中错误的是()。
层次型、网状型和关系型数据库的划分原则是()。
有以下程序段:struetst{intx;int*y;}*pt;inta[]={1,2},b[]={3,4};struetstc[2]={10,a,20,b};pt=c;以下选项中表达式的值为11的是()。
关于“while(条件表达式)循环体”,以下叙述正确的是()。
负责数据库中查询操作的数据库语言是()。
在数据库中,数据模型包括数据结构、数据操作和()。
结构化程序的三种基本控制结构是()。
随机试题
A.腔静脉B.主动脉C.微动脉D.毛细血管
其应辨证为若下痢白中兼赤者,应加
资产负债表反映的是企业经营期内全部资产、负债和所有者权益的情况。()
编制老年人设施规划时,老年人设施中养老院、老年公寓与老年人护理院配置的总床位数量计算依据是:[2017-24]
环境影响识别一般或小规模开发区主要考虑对()的影响,重污染或大规模(大于10km2)的开发区还应识别区外经济活动对区内的环境影响。
在计算土地增值税应纳税额时,纳税人为取得土地使用权支付的地价款准予扣除。这里的地价款是指( )。
篮球队教练要召集队员研究问题,要尽快通知到全部29名队员,通过电话通知最快,每个电话用一分钟。那么需要几分钟?()
黑龙江:哈尔滨
标志着清政府完全成为帝国主义统治中国的工具,中国彻底沦为半殖民地半封建社会的不平等条约是:
近几年中国的投资环境发生了根本性的变化,劳动力成本上升、劳动保护加强、土地成本上升、环保成本上升、能源资源使用成本上升、优惠政策取消,外资企业需要在更高的成本上与内资企业竞争,这是外资企业必须正视的事实和趋势。但要素和能源资源成本上升,伴随的是生产方式和经
最新回复
(
0
)