Uppercase

Time Limit: 2000/1000ms (Java/Others)

Problem Description:

 给出一句中间无特殊符号的英语句子,要求将各单词的首字母改大写。

Input:

先输入n,表示有n组测试数据,下面每一组数据为一句英语,且句子总长度不超过100。

Output:

输出每一组数据修改后的句子。

Sample Input:

3
hello world!
i am understand!
how are you!

Sample Output:

Hello World!
I Am Understand!
How Are You!
解题思路:水题!!!思路很简单,先将首字母改成大写,再依次遍历字符串,当a[i-1]是空格字符' '且a[i]是小写字母时,就将其换成大写字母,水过。
杭电hdu2026与此题一样,题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2026
AC代码:
 #include<bits/stdc++.h>
using namespace std;
int main()
{
char a[];int n;
cin>>n;getchar();
while(n--){
gets(a);
if(a[]>='a'&&a[]<='z')a[]=a[]-;
for(int i=;i<(int)strlen(a);i++)
if(a[i-]==' ' && (a[i]>='a'&&a[i]<='z'))a[i]-=;
cout<<a<<endl;
}
return ;
}

ACM_Uppercase(水题)的更多相关文章

  1. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  2. ACM :漫漫上学路 -DP -水题

    CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit ...

  3. ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)

    1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[ ...

  4. [poj2247] Humble Numbers (DP水题)

    DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...

  5. gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,

    1195: 相信我这是水题 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 821  Solved: 219 Description GDUT中有个风云人 ...

  6. BZOJ 1303 CQOI2009 中位数图 水题

    1303: [CQOI2009]中位数图 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 2340  Solved: 1464[Submit][Statu ...

  7. 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题

    B - 大还是小? Time Limit:5000MS     Memory Limit:65535KB     64bit IO Format: Description 输入两个实数,判断第一个数大 ...

  8. ACM水题

    ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...

  9. CF451C Predict Outcome of the Game 水题

    Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...

随机推荐

  1. Big String(poj 2887)

    题意: 给你一个不超过1e6的字符串,和不超过2000次的操作 操作分为两种: 1.将一个字符插入到某个位置的前面 2.询问当前位置的字符 /* 块状链表模板水题(我的智商也就能做这种题了). 观察题 ...

  2. js数组转换成json串 (JSON.stringify)

    例如: var giftlist[1490011777] = []; giftlist[1490011777]['id'] = 1490011777; giftlist[1490011777]['na ...

  3. AjaxFileUpload文件上传组件(php+jQuery+ajax)

    jQuery插件AjaxFileUpload可以实现ajax文件上传,下载地址:http://www.phpletter.com/contents/ajaxfileupload/ajaxfileupl ...

  4. jquery判断单选按钮radio是否选中的方法

    JQuery控制radio选中和不选中方法总结 一.设置选中方法 复制代码代码如下: $("input[name='名字']").get(0).checked=true; $(&q ...

  5. Bootstrap官网文档查询

    Ctrl+F 在出现的小搜索框里面输入要查找的东西.回车即可!

  6. mysql-performance-schema

    http://www.fromdual.com/mysql-performance-schema-hints http://www.cnblogs.com/cchust/

  7. 【CV论文阅读】+【搬运工】LocNet: Improving Localization Accuracy for Object Detection + A Theoretical analysis of feature pooling in Visual Recognition

    论文的关注点在于如何提高bounding box的定位,使用的是概率的预测形式,模型的基础是region proposal.论文提出一个locNet的深度网络,不在依赖于回归方程.论文中提到locne ...

  8. vuejs快速入门

    参考链接:http://www.cnblogs.com/keepfool/p/5619070.html

  9. dorker 安装

    http://www.docker.org.cn/book/install/install-docker-win7-win8-requirements-38.html1. 你先去下载Docker To ...

  10. 自己定义ViewGroup控件(一)-----&gt;流式布局进阶(一)

    main.xml <? xml version="1.0" encoding="utf-8"?> <com.example.SimpleLay ...