hd 2564词组缩写
来源:互联网 发布:兰蔻气垫好不好知乎 编辑:程序博客网 时间:2024/06/11 06:32
词组缩写
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 8881 Accepted Submission(s): 2833
比如,C语言里常用的EOF就是end of file的缩写。
接下来有T行,每组测试数据占一行,每行有一个词组,每个词组由一个或多个单词组成;每组的单词个数不超过10个,每个单词有一个或多个大写或小写字母组成;
单词长度不超过10,由一个或多个空格分隔这些单词。
1end of file
EOF
输出字符串型
#include<stdio.h>
#include<string.h>
int main()
{
int t,i,j,b;
char s[110],a[110];
while(scanf("%d",&t)!=EOF)
{
getchar();
while(t--)
{
j=0;
gets(s);
b=strlen(s);
for(i=0;i<b;i++)
{
if(i==0&&s[0]!=' ')
{
a[j++]=s[0];
continue;
}
if(s[i]==' '&&s[i+1]!=' ')
a[j++]=s[i+1];
}
strupr(a);
a[j]='\0';
puts(a);
}
}
return 0;
}
逐个输出字符型
#include<stdio.h>
#include<string.h>
int main()
{
char s[110];
int t,i;
while(scanf("%d",&t)!=EOF)
{
getchar();
while(t--)
{
gets(s);
for(i=0;i<strlen(s);i++)
{
if(s[i]>='a'&&s[i]<='z')
s[i]-=32;
}
for(i=0;i<strlen(s);i++)
{
if(i==0&&s[i]!=' ')
printf("%c",s[0]);
else if(s[i]!=' '&&s[i-1]==' ')
printf("%c",s[i]);
}
printf("\n");
}
}
return 0;
}
- hd 2564词组缩写
- 词组缩写 2564
- hdu 2564 词组缩写
- HDU-2564-词组缩写
- 词组缩写 2564HDU
- 2564:词组缩写
- hdu 2564 词组缩写
- HDU 2564 词组缩写
- HDU 2564 词组缩写
- 词组缩写 HDU-2564
- 杭电2564----词组缩写
- HDOJ/HDU 2564 词组缩写(单词缩写)
- 词组缩写
- 词组缩写
- 词组缩写
- 词组缩写
- 词组缩写
- 词组缩写
- django models交叉引用问题的解决方案
- 静默安装Oracle12C 并使用TSM备份Oracle
- 比较全面的gdb调试命令
- 原先实施楼市限购的大中城市或明或暗宣布放开限购
- 提高编程技能的方法(修订版)
- hd 2564词组缩写
- BZOJ 1643: [Usaco2007 Oct]Bessie's Secret Pasture 贝茜的秘密草坪
- Spring的事务处理之编程式事务处理
- 用.class文件创建对象
- 网站
- 至我最爱的人小梦
- 各地方政府为何要在此时集中放开限购令呢?7月中旬,上半年经济数据新鲜出炉
- javascript 正则匹配 提取全部 preg_match_all matchAll方法
- Mapper过程中Combiner的作用