用指针将英文句子的单词首字母转换为大写的c语言程序
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/10 20:57:49
thinkinterestinghavelessonMondayFridayWillteache
friendplayingtakingsamehobbycameseewasboth老师祝你学习进步!望采纳,多谢!^_^
#includevoidmain(){charx[80];//声明一个数组存放字符串inti;printf("请输入英文语句\n");gets(x);//获取字符串for(i=0;x[i]!='\0'
LeftheartfailureIwillusetherighthearttoloveyou左心衰竭的我会用右心去爱你
saveddiscussfightconvenientdugcarry
#includevoidmain(){charx[100];inti;printf("请输入英语句子\n");gets(x);x[0]=x[0]-32;for(i=1;x[i]!='\0';i++){
seelibrarybyhaveanimal
DimJZAsStringJZ="Aslongasthereisareasonablepossibility,wewillaskyoutoprovidepersonalinformationtoyou
我说一个想法吧,在C语言里不是有ASCII码的吗?-32不就可以了吗?怎么会这么复杂再问:我就是用ASCII码写的。。。再答:哦哦,我没仔细看。那你是哪有问题啊
C++?再问:比如说若输入:Iamastudenttotaketheexamination.,则应输出:IAmAStudentToTakeTheExamination.。再答:方法1限制单词长度:#i
方法1限制单词长度:#include#include#includeintmain(){charc,*pstr;charszWord[16];while(1){pstr=szWord;while((c
Maryisagoodstudent.Sheis【seldom】lateforschool.Bobby,JackandJohnaregoodfriends.Theyoftengotothebeach【
1,atter2,chehouldoctor3,as,octor4,everad5,asoes
输入一个英文句子,将句子中每个单词的首字母大写后输出.例如输入thisis方法1限制单词长度:#include
1.stoppd2.without3.sleep4.why再问:5、UsuallyIhavericefordinner,buttodayi’llhavedumplings(i)再答:5.instead
takevaseCDbathroomnurseumbrella
其实就是先检测空格,直到没有空格的第一个字符,判断是否为小写字母,若是则转换成大写;若不是,因为输入的是英文,不必担心数字问题,那就只能是大写字母,不用转换.
destinationswereyou!你就是归宿
指针-钟表等:hand;clockhand这块表有三个指针.Thisclockhasthreehands.时钟的指针走得很慢.Thehandsofaclockturnveryslowly.手表有三根指