首字母变大写(stringstream的应用)
#include<bits/stdc++.h>
#define LL long long
using namespace std;
int main()
{
char c[];
while(gets(c))//读取一行
{
stringstream ss(c);//复制
string s;bool r=true;
while(ss>>s)//从ss读入s中
{
s[]=toupper(s[]);//将小写变为大写
if(r==true) {r=;cout<<s;}
else cout<<" "<<s;
}
cout<<endl;
}
}
首字母变大写(stringstream的应用)的更多相关文章
- ytu 1938:首字母变大写(水题)
首字母变大写 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 110 Solved: 43[Submit][Status][Web Board] Desc ...
- HDOJ2026首字母变大写
首字母变大写 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Subm ...
- YTU 2760: 字符串---首字母变大写
2760: 字符串---首字母变大写 时间限制: 1 Sec 内存限制: 128 MB 提交: 343 解决: 136 题目描述 输入一行英文句子,将每个单词的第一个字母改成大写字母. 输入 一个 ...
- HDU 2026 首字母变大写
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int ma ...
- HDOJ 2026 首字母变大写
Problem Description 输入一个英文句子,将每个单词的第一个字母改成大写字母. Input 输入数据包含多个测试实例,每个测试实例是一个长度不超过100的英文句子,占一行. Outpu ...
- HDU_2026——将单词的首字母变大写
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"> ...
随机推荐
- codeforce 461DIV2 E题
题意 有n棵树排成一排,每个树上都有c[i]只小鸟,只有站在树下才可以召唤小鸟,在i-th树下召唤k(k<=c[i])只小鸟需要消耗cost[i]*k的法力值,但是每召唤一只小鸟可以将法力值的上 ...
- 刷题向》POJ2823 单调队列裸题(<不会做,请自裁>系列)
最近BZOJ炸了,而我的博客上又更新了一些基本知识,所以这里刷一些裸题,用以丰富知识性博客 POJ2823 滑动的窗口 这是一道经典的单调队题,我记得我刚学的时候就是用这道题作为单调队列的例题,算 ...
- layer使用总结一配置
导入layer.js文件即可,必须先导入jquery.js文件,因为layer是基于jquery 版本匹配,在此记录一下,layer使用1.8下载时是2.3的版本,对应的jquery使用1.8.3版本 ...
- mysql 索引 笔记1
#不同的存储引擎支持的索引类型也不一样 InnoDB 支持事务,支持行级别锁定,支持 B-tree.Full-text 等索引,不支持 Hash 索引: MyISAM 不支持事务,支持表级别锁定,支持 ...
- 在线创建MongoDB免费集群(MangoDB Atlas)
MongoDB Atlas是MongoDB的云服务,构建在亚马逊的AWS上,MongoDB允许用户在上面创建一个免费集群作为学习使用. 1. 注册MongoDB cloud账号: 访问www.mong ...
- Marvel
Marvel and what it is From http://www.tuicool.com/articles/qA3yau With marvel you can get an overvie ...
- 局部变量和static变量的区别
static int a ; int b; scanf_s("%d %d",&a,&b); 01374212 lea eax,[b] 01374215 push e ...
- laravel查询最后执行的一条sql语句
- .net对Cookie的简单操作
1 声明:HttpCookie MyCookie= new HttpCookie("test"); 2增加:MyCookie.Values.Add("key1" ...
- POJ1753 Flip Game(位运算+暴力枚举)
Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 square ...