题目1121:首字母大写
2017-04-18 10:27
183 查看
#include <iostream> #include <stdio.h> #include <algorithm> #include <math.h> #include <string> #include <string.h> #include <vector> #include <queue> #include <stack> #include <sstream> using namespace std; //1121 char s[110]; void toUpper(char *c){ if(*c>='a'&&*c<='z') *c=*c-'a'+'A'; } int main(){ //freopen("input.txt","r",stdin); while(gets(s)!=NULL){ for(int i=0;i<strlen(s);i++){ if(i==0) toUpper(&s[i]); else if(s[i-1]==' '||s[i-1]=='\t'||s[i-1]=='\r') toUpper(&s[i]); } printf("%s\n",s); } return 0; } /************************************************************** Problem: 1121 User: cust123 Language: C++ Result: Accepted Time:0 ms Memory:1520 kb ****************************************************************/
相关文章推荐
- 题目1121:首字母大写
- 题目1121:首字母大写
- 九度OJ 题目1121:首字母大写
- 九度OJ 题目1121:首字母大写
- 题目1121:首字母大写
- 题目1121:首字母大写
- 题目1121:首字母大写
- 九度OJ 1121:首字母大写 (字符串处理)
- 3. 串的处理 在实际的开发工作中,对字符串的处理是最常见的编程任务。 本题目即是要求程序对用户输入的串进行处理。具体规则如下: 1. 把每个单词的首字母变为大写。 2. 把数字与
- 九度oj-1121-首字母大写
- 串的处理 在实际的开发工作中,对字符串的处理是最常见的编程任务。本题目即是要求程序对用户输入的串进行处理。具体规则如下: 1. 把每个单词的首字母变为大写。 2. 把数字与字母之间用下划线字符(_)分
- 杭电 2026 首字母变大写(题目有点水,但不妨碍我比它更水= =)
- 九度OJ 1121:首字母大写 (字符串处理)
- SDUTACM首字母变大写
- F - 首字母变大写
- HDU-2026 首字母变大写
- Android Studio:Button控件中英文字母全部默认显示为大写的解决方法
- 输入小写字母自动变为大写,反之亦然
- Android Button设置文字 字母自动变大写...
- CSS中首字母大写怎么实现?