> 其他 >
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!
请按任意键继续…
人气:269 ℃ 时间:2020-03-30 19:23:12
解答
#include
#include
#include
using namespace std;
int main()
{
string str;
while(1)
{
coutstr;
if(str == "0")
{
cout
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版