首字母变大写
来源:互联网 发布:淘宝60s视频制作软件 编辑:程序博客网 时间:2024/04/29 21:38
首字母变大写
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 107 Accepted Submission(s) : 56
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
输入一个英文句子,将每个单词的第一个字母改成大写字母。
Input
输入数据包含多个测试实例,每个测试实例是一个长度不超过100的英文句子,占一行。
Output
请输出按照要求改写后的英文句子。
Sample Input
i like acmi want to get an accepted
Sample Output
I Like AcmI Want To Get An Accepted
C语言程序代码
/*这题比较简单,不做解释。
要点一:用gets()输入,以为有空格。
要点二:大小写转换ASCLL码相差32。
*/
#include<stdio.h>
#include<math.h>
#include<string.h>
int main(){
int i,j,n,m,l;
char a[101];
while(gets(a))
{
l=strlen(a);
for(i=0;i<l;i++)
{
if(i==0||a[i-1]==' ')
{
a[i]-=32;
printf("%c",a[i]);
}
else
printf("%c",a[i]);
}
printf("\n");
}
return 0;
}
0 0
- 2026 首字母变大写
- HDOJ2026 首字母变大写
- hdu2026 首字母变大写
- 首字母变大写
- hdu2026首字母变大写
- hdoj_2026 首字母变大写
- 首字母变大写
- hdu-首字母变大写
- 【首字母变大写 2026】
- acm--首字母变大写
- 1249首字母变大写
- 首字母变大写
- 首字母变大写
- HDU_2026首字母变大写
- 2026 首字母变大写
- hdu2026 首字母变大写
- HDU_2026 首字母变大写
- 首字母变大写(2026)
- Failed to instantiate the default view controller for UIMainStoryboardFile 'Main1' - perhaps the des
- 如何设置apache+php的上传文件大小上限
- 数据结构和设计模式04(hash表)
- Swift 判断是否是int
- java基础语法--01
- 首字母变大写
- 你是不是闭着眼睛做应用?(数据驱动决策(一))
- hdu 5288OO’s Sequence
- 设计模式之单一职责原则
- 分享收藏网址
- 重载与覆盖
- C语言实现递归删除文件夹
- iOS ---- CornerStone上传静态库.a
- HD2030 汉字统计