问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

将每一行字符中的每个单词的第一个字母改写成大写

发布网友 发布时间:2023-01-21 06:30

我来回答

2个回答

热心网友 时间:2023-10-15 22:55

#include <stdio.h>
#include <stdlib.h>

int main() {
char s[8192],*p;
char *filename = "F:\\VC\\example.txt";
int i,ch,len;
FILE *fp;
fp = fopen(filename,"rt");
if(fp == NULL) {
printf("can't Open %s\n",filename);
exit(1);
}
i = 0;
while((ch = fgetc(fp)) != EOF) {
s[i] = ch;
i++;
}
s[i] = '\0';
len = i;
fclose(fp);
p = s;
while(*p) putchar(*p++);
printf("\n\n");
if((s[0] >= 'a') && (s[0] <= 'z')) s[0] -= ('a' - 'A');
i = 1;
while(s[i]) {
while((s[i]) && (s[i] != '.') && (s[i] != '\n')) i++;
if(s[i]) {
while(((s[i] < 'a') || (s[i] > 'z')) && (s[i])) i++;
if(s[i]) s[i] -= ('a' - 'A');
}
i++;
}
p = s;
while(*p) putchar(*p++);
printf("\n\n");
return 0;
}
example.txt
in Europe,where people seem to improve their trains as fast as wei in the United States retire ours,we have living proof that railroads can compete with,and often outstrip,airlines and cars."if the distance is seven hundred miles or more,people in Europe might prefer to fly,"says an offical of the French National Railroads,"but when you get down to four or five hundred miles the train is convenient,"In France ,a businessman says to his secretary,"what's the next train to Lyons?"--not the next plane.taking the train is a way of life.as the fleet of Europe trains continues to cat the time between major cities in the bid to hit the magic 125 miles per hour mark,airlines are halting of diminishing short -- haul service and concertraining on the longer runs.
转换后的example.txt
In Europe,where people seem to improve their trains as fast as wei in the United States retire ours,we have living proof that railroads can compete with,and often outstrip,airlines and cars."If the distance is seven hundred miles or more,people in Europe might prefer to fly,"says an offical of the French National Railroads,"but when you get down to four or five hundred miles the train is convenient,"In France ,a businessman says to his secretary,"what's the next train to Lyons?"--not the next plane.Taking the train is a way of life.As the fleet of Europe trains continues to cat the time between major cities in the bid to hit the magic 125 miles per hour mark,airlines are halting of diminishing short -- haul service and concertraining on the longer runs.

热心网友 时间:2023-10-15 22:56

Ruby
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
重本和一本一样吗 永劫无间是第几人称:小说叙事视角分析 名字未定(第三人称双男主 周霖 温宿) 我得了职业病〈轻度苯中毒〉,有职业病诊断证明书.工伤认定期间我没上... ...后来感觉麻烦,就直接去药店买药,他开了很多 这是十年前的功放,求高手看看那几个孔是什么? 车子断保险之后再交是一样的吗 车险断交后再续交 女性查激素六项什么时候检查 有一个素质很低下的室友是一种什么样的体验? 新鲜笋子煮麻辣鱼怎么做 笋子煮麻辣鱼的做法 《反向樱花般的爱恋(TF)》兰醉txt全集下载 肉的英文是什么? 企业微信党费缴纳不见了 防疫时代,每个群里总有一个或多个司职“放倒消息树”的热心人 商铺管家疫情期间与业主如何互动 中风险怎么给业主说话 吃过螃蟹多久能吃柿子 昨天凌晨一点用支付宝转中国银行什么时间到账呢 闲鱼PRO开通后系统下架还能再开通吗 如何区分小区物业维修工与水暖工、电工? 物业里面的泥水工一般多少钱一月? 深圳西乡哪里有水电安装维修师傅泥水工 《QQ》底部频道关闭方法 惠普打印机不工作怎么办? 白灰墙油烟渍怎么去除 小恩爱最新版本中有个任务,任务里面的ta登录游戏指的是登录哪儿的游戏... 身份证怎么注册? 华为手机查找设备删除了紧急联系人对方还能共享位置吗? 北京越南距离多少公里 越南多少省? 一汽丰田销量 丰田威驰遥控器可以启动车吗 鬼迷心窍形容感情是什么意思 墨水弄衣服上了怎么洗 腾讯会议没有摄像头怎么办? 额定制冷量3550w是几匹 微信朋友圈怎么从相机找回 信息系统监理师是二级职称吗? 信息系统监理师是什么考试? 占总热能的百分比怎么算公式 微信里发一个大拇和一个小绿人什么意思 微信表情包三个枚瑰花三个手掌三个&#xF44D;是什么意思? 美码11码是多大尺寸 普洱茶,生茶好还是熟茶好? 怎样做糖油果 成都东门吃货小巷(2) 双流城区有一家很好吃的糖油果子在那儿铺面很简陋! 有什麼好看的黑道校园小说? win10为什么打不开exe文件 芒果斗地主怎么查询充值记录