Problem D: 零起点学算法106——首字母变大写

Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 18252  Solved: 5211

Description

输入一个英文句子,将每个单词的第一个字母改成大写字母。

Input

输入数据包含多个测试实例,每个测试实例是一个长度不超过100的英文句子,占一行。

Output

请输出按照要求改写后的英文句子。

Sample Input

i like acm
i want to get an accepted

Sample Output

I Like Acm
I Want To Get An Accepted
代码如下:
#include<bits/stdc++.h>
using namespace std; int main(){
char a[101];
while(gets(a)!=NULL){
a[0]=toupper(a[0]);
for(int i=1;i<(int)strlen(a);i++){
if(a[i]==' ') a[i+1]=toupper(a[i+1]);
}
printf("%s\n",a);
} return 0;
}

ZSTUOJ刷题11:Problem D.--零起点学算法106——首字母变大写的更多相关文章

  1. Problem G: 零起点学算法106——首字母变大写

    #include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...

  2. Problem F: 零起点学算法101——统计字母数字等个数

    #include<stdio.h> #include<string.h> int main(){ ]; while(gets(str)!=NULL){ ,b=,c=,d=; ; ...

  3. Problem H: 零起点学算法109——单数变复数

    #include <stdio.h> #include<string.h> int main(void) { int n; ]; scanf("%d",&a ...

  4. Problem D: 零起点学算法95——弓型矩阵

    #include<stdio.h> #include<string.h> int main() { ][]; while(scanf("%d%d",& ...

  5. Problem F: 零起点学算法42——多组测试数据输出II

    #include<stdio.h> int main() { ; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { ...

  6. Problem E: 零起点学算法34——3n+1问题

    #include<stdio.h> #include<math.h> int main() { int n; n<=pow(,); ; scanf("%d&qu ...

  7. Problem K: 零起点学算法107——统计元音

    #include<stdio.h> int main() { int n; ]; while(scanf("%d%*c",&n)!=EOF) { while(n ...

  8. Problem J: 零起点学算法105——C语言合法标识符

    #include<stdio.h> #include<ctype.h>//调用isalpha函数 int main() { int n; ]; while(scanf(&quo ...

  9. Problem I: 零起点学算法104——Yes,I can!

    #include<stdio.h> int main() { ]; while(gets(a)!=NULL) { printf("I am "); printf(&qu ...

  10. Problem H: 零起点学算法103——查找最大元素

    #include<stdio.h> #include<string.h> int main() { ]; while(gets(a)!=NULL) { ]; ;a[i]!='\ ...

随机推荐

  1. 南大ics-pa/PA0过程及感想

    实验教程地址:https://nju-projectn.github.io/ics-pa-gitbook/ics2022/index.html 一.Ubuntu安装 在清华大学镜像站下载了Ubuntu ...

  2. Linux使用tailf高亮显示关键字

    Linux下使用tail查找日志文件关键词高亮显示 ① 多个关键词高亮显示: tail -f 日志文件 | perl -pe 's/(关键词)/\e[1;颜色$1\e[0m/g' 示例: tail - ...

  3. win11恢复完整右键菜单

    使用注册表修改 首先,通过修改注册表,我们就可以将 Win11 的右键菜单改为老样式.下面是具体的方法. 运行"regedit",开启注册表编辑器,定位到"HKEY_CU ...

  4. SQL Server性能优化工具Profiler

    SQL Server Profiler是什么 SQL Server Profiler是一个界面,用于创建和管理跟踪并分析和重播跟踪结果. 这些事件保存在一个跟踪文件中,稍后试图诊断问题时,可以对该文件 ...

  5. 提交from表单,method与浏览器请求显示不一致

    <from method="post" action ="/login_check"> 用户名:<input type="text& ...

  6. OpenLayer——绘制带箭头的线

    绘制带箭头的线,计算相对复杂,多少是有点影响性能了.更简单的做法:初始.目标点用不同的点进行强调即可. <!DOCTYPE html> <html lang="en&quo ...

  7. 生态学建模:增强回归树(BRT)预测短鳍鳗生存分布和影响因素|附代码数据

    全文下载链接: http://tecdat.cn/?p=22482 最近我们被客户要求撰写关于增强回归树(BRT)的研究报告,包括一些图形和统计输出. 在本文中,在R中拟合BRT(提升回归树)模型.我 ...

  8. Windows Codename"Longhorn" Build 4074体验

    Windows Codename"Longhorn" Build 4074体验 Wimndows Coodename "Longhorn"就是WindowsVi ...

  9. HIVE - HIVEQL学习笔记

    Hive Learning HIVEQL和MYSQL最为接近 数据操作 SHOW TABLES IN crm_integration Show tables 'dim_con*' DESCRIBE E ...

  10. Rinetd linxu TCP 端口转发

    Rinetd是为在一个Unix和Linux操作系统中为重定向传输控制协议(TCP)连接的一个工具,实现端口映射/转发/重定向.Rinetd是单一过程的服务器,它处理任何数量的连接到在配置文件etc/r ...