码迷,mamicode.com
首页 > Windows程序 > 详细

Word Capitalization

时间:2014-08-11 09:56:41      阅读:346      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   java   os   io   

Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u

Description

Capitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word.

Note, that during capitalization all the letters except the first one remains unchanged.

Input

A single line contains a non-empty word. This word consists of lowercase and uppercase English letters. The length of the word will not exceed 103.

Output

Output the given word after capitalization.

Sample Input

ApPLe

ApPLe

konjac

Konjac

很水的一道题,但是要注意if的条件范围和用什么比较

代码:

#include<stdio.h>
#include<string.h>

int main()
{
    char s[1001];
    while(~scanf("%s",s))
    {
        if(s[0]==\0)
           break;
        else if(s[0]>=a&&s[0]<=z)
           s[0]-=32;
        printf("%s\n",s);
    }
    return 0;
}

 

Word Capitalization,布布扣,bubuko.com

Word Capitalization

标签:des   style   blog   http   color   java   os   io   

原文地址:http://www.cnblogs.com/lipching/p/3903965.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!