ytu 1938:首字母变大写(水题)
首字母变大写
Time Limit: 1 Sec Memory Limit: 64 MB
Submit: 110 Solved: 43
[Submit][Status][Web Board]
Description
Input
Output
Sample Input
i want to get an accepted
Sample Output
I Want To Get An Accepted
HINT
#include <iostream> using namespace std; int main()
{
char s[];
while(cin.getline(s,,'\n')){
int i;
for(i=;s[i]!='\0';i++){
if(('a'<=s[i] && s[i]<='z')){
s[i]-=;
break;
}
}
for(i=i+;s[i]!='\0';i++){
if(s[i]==' '){
if( ('a'<=s[i+] && s[i+]<='z') && s[i+]!='\0'){
s[i+]-=;
}
}
}
cout<<s<<endl;
}
return ;
}
Freecode : www.cnblogs.com/yym2013
ytu 1938:首字母变大写(水题)的更多相关文章
- YTU 2760: 字符串---首字母变大写
2760: 字符串---首字母变大写 时间限制: 1 Sec 内存限制: 128 MB 提交: 343 解决: 136 题目描述 输入一行英文句子,将每个单词的第一个字母改成大写字母. 输入 一个 ...
- HDOJ2026首字母变大写
首字母变大写 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Subm ...
- HDOJ 2026 首字母变大写
Problem Description 输入一个英文句子,将每个单词的第一个字母改成大写字母. Input 输入数据包含多个测试实例,每个测试实例是一个长度不超过100的英文句子,占一行. Outpu ...
- HDU 2026 首字母变大写
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int ma ...
- HDU_2026——将单词的首字母变大写
Problem Description 输入一个英文句子,将每个单词的第一个字母改成大写字母. Input 输入数据包含多个测试实例,每个测试实例是一个长度不超过100的英文句子,占一行. O ...
- 首字母变大写(stringstream的应用)
Problem Description 输入一个英文句子,将每个单词的第一个字母改成大写字母. Input 输入数据包含多个测试实例,每个测试实例是一个长度不超过100的英文句子,占一行. O ...
- [Go] 第一个单词首字母变大写:Ucfirst(),第一个单词首字母变小写:Lcfirst()
import ( "unicode" ) func Ucfirst(str string) string { for i, v := range str { return stri ...
- Problem G: 零起点学算法106——首字母变大写
#include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...
- "首字母变大写"组件:<capitalize> —— 快应用组件库H-UI
 <import name="capitalize" src="../Common/ui/h-ui/text/c_text_capitalize"> ...
随机推荐
- 取消chrome浏览器下input和textarea的默认样式
最近一个细节引起了我的注意,chrome浏览器下的input和textarea在聚焦的时候都有一个黄色的边框,而且textarea还可以任意拖动放大,这是不能容忍的,影响美观不说,有时候拖动texta ...
- 锋利的jQuery-6--序列化函数serialize()和serializeArray()在表单提交中的作用
在通过jQuery ajax提交表单的时候,通常用下边的方法获取表单内容. var form = 'add-account-form'; //表单id $('#' + form).submit(fun ...
- 织梦(dedecms) 5.7 /plus/car.php sql注入0day
测试方法: @Sebug.net dis本站提供程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负! <?php $host=$argv[1]; $path=$argv[2]; $ ...
- .NET笔试面试题
.NET 1.const和readonly的区别? 2.静态类和实例区别?什么时候使用? 3.接口和抽象类的区别?什么时候使用? 4.类和结构体的区别?什么时候使用? 5.文件操作 6.序列化 7.O ...
- 整理时下流行的浏览器User-Agent大全
总结整理时下流行的浏览器User-Agent大全 此文章转至:http://www.360doc.com/content/12/1012/21/7662927_241124973.shtml 用于学习 ...
- Ubuntu 中软件的安装、卸载以及查看的方法总结
Ubuntu 中软件的安装.卸载以及查看的方法总结 博客分类: Linux UbuntuDebian配置管理CacheF# 说明:由于图形化界面方法(如Add/Remove... 和Synaptic ...
- wordpress编辑主题时报错Warning: scandir() has been disabled for security reasons in
在ubuntu下面安装了一个wordpress程序,在后台什么都没干,编辑主题时,发现页面中报下面的错误. notice: /home/wwwroot/test.localhost/wordpress ...
- JS判断一个数组中是否有重复值的三种方法
方法一: var s = ary.join(",")+","; for(var i=0;i<ary.length;i++) { if(s.replace( ...
- Open Credit System
Open Credit SystemInput: Standard Input Output: Standard Output In an open credit system, the studen ...
- HNU 12817 Shipura(表达式求值)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12817 解题报告:定义两种运算符号,一种是>>,就 ...