1165: 零起点学算法72——首字母变大写

1165: 零起点学算法72——首字母变大写

Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lld
Submitted: 705  Accepted: 439
[Submit][Status][Web Board]

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

Source

 
 1 #include<stdio.h>
 2 int main(){
 3     char a[100];
 4     while(gets(a)!=NULL){
 5         a[0]+='A'-'a';
 6         for(int i=1;a[i]!='