阅读给定C++程序,写出各输入对应的输出结果

wn983809 程序题 共 个子题

阅读程序填写结果:

#include<iostream>
#include<string>
using namespace std;
int main(){
string str;
cin>>str;
for(int i=0;i<str.length();i++)
{
if(str[i]>='a' && str[i]<='z')
    str[i]=(str[i]-'a')+'A';
else if(str[i]>='A' && str[i]<='Z')
    str[i]=(str[i]-'A')+'a';
else if(str[i]>='0' && str[i]<='9')
    str[i]=(str[i]-'0'+3)%10+'0';
}
cout<<str<<endl;
return 0;
}
题号 第1题 第2题 第3题 第4题
输入数据 These N92 12+96 This is a pen.
输出数据

本题为编程题,提交代码并运行通过测试点后判分。

正在加载题目数据…
已答 /
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析
提交记录
共 条 仅展示自由练习提交
正在加载提交记录…
讨论
发布
登录后参与讨论 立即登录
发布讨论需先绑定并验证手机号 去绑定手机号
加载中…
我
我
回复 @
回复 @
发送
还没有人讨论,来发表第一条吧