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. Pytorch实战学习(五):多分类问题

    <PyTorch深度学习实践>完结合集_哔哩哔哩_bilibili Softmax Classifer 1.二分类问题:糖尿病预测 2.多分类问题 MNIST Dataset:10个标签, ...

  2. (1028) 权限,chmod、chgrp、chown详解

    https://www.cnblogs.com/Berryxiong/p/6193866.html 例1: $ chgrp - R book /opt/local /book 改变/opt/local ...

  3. python3 - Django3.2框架

    提示:web开发已有php.java,而python在这方面,没有优势,python的优势在于:爬虫.人工智能.大数据分析等,python在web开发这方面,没必要掌握:版本:稳定版本:3.2(py3 ...

  4. for in 和 for of 的区别(枚举解释)

    一.for....of 1.for-of是作为ES6新增的遍历方式,允许遍历一个含有iterator接口的数据结构(数组.对象等)并且返回各项的值,普通的对象用for-of遍历是会报错的. 2.for ...

  5. android系统签名文件路径及签名方法

    在系统源码路径下 签名文件路径:android/build/target/product/security/ 准备好签名工具:"signapk.jar" 位置:android/pr ...

  6. 音视频技术入门课- 05 使用FFmpeg与OBS进行直播推流

    做直播推流的前提是要有直播服务器接收直播流,所以需要我们自己建设一个流媒体服务器. 流媒体服务器SRS SRS是一个简单高效的实时视频服务器,支持RTMP/WebRTC/HLS/HTTP-FLV/SR ...

  7. 静态变量设为non-public或者加final关键字

    Class variable fields should not have public accessibility Vulnerability Minor Main sources cwe Avai ...

  8. zabbix5.2+mysql+ubuntu20.4

    服务端 0.初始化机器 1.mysql安装 # apt-get install mysql-server # apt update 根据提示一步一步确认,要求输入的密码是创建管理员的密码 2.安装za ...

  9. Zookeeper ZAB协议

    这篇博客是从源码的角度了解Zookeeper 从接收客户端请求开始,到返回数据为止,有很多涉及到的对象创建因为在前几篇文章已经说明过了,这里就不再重复的说明了,如果不是很明白的的,可以先看前几篇博文了 ...

  10. RSTP-快速生成树协议

    1 STP的不足之处STP协议虽然能够解决环路问题,但是由于网络拓扑收敛慢,影响了用户通信质量. 2 RSTP概述RSTP在许多方面对STP进行了优化,它的收敛速度更快,而且能够兼容STP. 通过接口 ...