c++ 输入一字串后.将字串里大写英文字转成小写、小写英文字转成大写
请设计一回圈程式,此程式会不断要求使用者输入一字串(字元数不超过
20),直到输入值为0 才结束程式.每当输入完一字串后,程式即将字串里
的所有英文字作转换动作(大写英文字转成小写、小写英文字转成大写),并
输出至萤幕上.
范例如下:
Please input a string:^aBcdEfg
The converted string is ^AbCDeFG.
Please input a string:aBc
The converted string is AbC
Please input a string:0
See You Next Time!Bye Bye!
请按任意键继续…
人气:158 ℃ 时间:2020-03-30 19:23:12
解答
#include
#include
#include
using namespace std;
int main()
{
string str;
while(1)
{
coutstr;
if(str == "0")
{
cout
推荐
猜你喜欢
- 一件衣服原价是2800元,现在打八五折,比原价便宜了多少元?
- 锐角α满足2tan(π-α)+3cos(π/2-β)+5=0,tan(π+α)+6sin(π+β)-1=0,则cosa为
- 一个圆的周长是6.28分米,那么它的面积是_平方分米.
- 在正方形ABCD中,E是对角线AC上一点,AB=AE,P是EB上任意一点,PF⊥AB,PG⊥AC,垂足分别为点F,G
- 分解因式:(x2-1)(x+3)(x+5)+12=_.
- very few people understood his words.改为同义句very few people understood---he---.
- 三角函数的诱导公式中cot是什么
- 已知正比例函数Y=4/3X图像与一次函数Y=3X-5图像相交与点A,且一次函数Y=3X-5图像相交于Y轴的图像相交于点B