hdu 2564 词组缩写
来源:互联网 发布:centos6修改ssh端口 编辑:程序博客网 时间:2024/06/11 23:36
Problem Description
定义:一个词组中每个单词的首字母的大写组合称为该词组的缩写。
比如,C语言里常用的EOF就是end of file的缩写。
比如,C语言里常用的EOF就是end of file的缩写。
Input
输入的第一行是一个整数T,表示一共有T组测试数据;
接下来有T行,每组测试数据占一行,每行有一个词组,每个词组由一个或多个单词组成;每组的单词个数不超过10个,每个单词有一个或多个大写或小写字母组成;
单词长度不超过10,由一个或多个空格分隔这些单词。
接下来有T行,每组测试数据占一行,每行有一个词组,每个词组由一个或多个单词组成;每组的单词个数不超过10个,每个单词有一个或多个大写或小写字母组成;
单词长度不超过10,由一个或多个空格分隔这些单词。
Output
请为每组测试数据输出规定的缩写,每组输出占一行。
Sample Input
1end of file
Sample Output
EOF
#include "iostream"#include "stdio.h"#include "string.h"using namespace std;int main(){ int C; int n; int Loop; char str[205]; while(~scanf("%d",&C)) { scanf("%*c"); while(C --) { memset(str,0,sizeof(char) * 205); gets(str); n = strlen(str); if((str[0] != ' ') && (str[0] >= 'a' && str[0] <= 'z')) { printf("%c",str[0] - 32); } else if((str[0] != ' ') && (str[0] >= 'A' && str[0] <= 'Z')) { printf("%c",str[0]); } for(Loop = 1; Loop < n; Loop ++) { if((str[Loop - 1] == ' ') && (str[Loop] != ' ') && (str[Loop] >= 'a' && str[Loop] <= 'z')) { printf("%c",str[Loop] - 32); } else if((str[Loop - 1] == ' ') && (str[Loop] != ' ') && (str[Loop] >= 'A' && str[Loop] <= 'Z')) { printf("%c",str[Loop]); } } printf("\n"); } } return 0;}
0 0
- hdu 2564 词组缩写
- HDU-2564-词组缩写
- 词组缩写 2564HDU
- hdu 2564 词组缩写
- HDU 2564 词组缩写
- HDU 2564 词组缩写
- 词组缩写 HDU-2564
- HDOJ/HDU 2564 词组缩写(单词缩写)
- HDU—— 2564 词组缩写
- HDU 2564 词组缩写 标准大水题
- HDU 2464 词组缩写
- 词组缩写 2564
- hd 2564词组缩写
- 2564:词组缩写
- hdu——2564——词组缩写
- 杭电2564----词组缩写
- 词组缩写
- 词组缩写
- poj 2142 The Balance(扩展欧几里得)
- UIScrollView的分页和使用
- 判定是否为子树
- 面向对象(三)
- JQuery与Ajax调用新浪API获取短网址
- hdu 2564 词组缩写
- [母函数]HDU 1028 Ignatius and the Princess III
- UITableView的基本使用一
- 搜狗输入法如何输入直角引号(「『』」 )
- 九度oj 题目1042:Coincidence
- 大数据视频
- Photoshop制作身份证1寸照片
- Recall和Precision
- 题目1184:二叉树遍历