大小写互换
来源:互联网 发布:淘宝买大麻暗语2016 编辑:程序博客网 时间:2024/05/01 10:30
大小写互换
时间限制:1000 ms | 内存限制:65535 KB
难度:0
- 描述
- 现在给出了一个只包含大小写字母的字符串,不含空格和换行,要求把其中的大写换成小写,小写换成大写,然后输出互换后的字符串。
- 输入
- 第一行只有一个整数m(m<=10),表示测试数据组数。
接下来的m行,每行有一个字符串(长度不超过100)。 - 输出
- 输出互换后的字符串,每组输出占一行。
- 样例输入
2AcmACCEPTED
- 样例输出
aCMaccepted
查看代码---运行号:252370----结果:Accepted
运行时间:2012-10-05 17:15:08 | 运行人:huangyibiao
01.
#include <cstdio>
02.
using
namespace
std;
03.
04.
int
main()
05.
{
06.
int
t;
07.
scanf
(
"%d "
, &t);
08.
while
(t--)
09.
{
10.
char
c;
11.
while
(
true
)
12.
{
13.
c =
getchar
();
14.
if
(c ==
'\n'
)
15.
break
;
16.
if
(c -
'a'
>= 0)
//小写
17.
printf
(
"%c"
, c-32);
18.
else
19.
printf
(
"%c"
, c+32);
20.
}
21.
putchar
(10);
22.
}
23.
return
0;
24.
}
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写互换
- 大小写字母互换
- 南阳理工:大小写互换
- 字符串大小写互换
- NYOJ 457 大小写互换
- 水:大小写互换
- NYOJ457大小写互换
- android错误:The method makeText(Context, CharSequence, int) in the type
- 黑马程序员13——LINQ的常用查询符
- 【数据结构】创建二叉树的方法
- 25+个可供选择的开源数据库引擎
- JAVA中适配器设计模式的简单介绍
- 大小写互换
- varchar char text
- B-tree/B+tree/B*tree
- 解决win7下vc6.0打开添加文件错误 崩溃
- 玛法都是3的幂次方 重量x的物品砝码匹配
- Ubuntu下Hadoop单机部署及分布式集群部署
- [转载]给在读研究生的一封信
- DemonStar
- [specflow] using sope to bind class with tag