打到头晕,结果……我输出呢???
查看原帖
打到头晕,结果……我输出呢???
955954
Miracle_InDream楼主2023/9/1 21:18
#include<bits/stdc++.h>
using namespace std;
string a,b;
int l;
void use1(){
	for(int i=0;i<l;i++){
		if((a[i]+3>='A')&&(a[i]+3<='Z')||(a[i]+3>='a')&&(a[i]+3<='z')){
			a[i]=(char)a[i]+3;
		}
		else{
			a[i]=(char)(a[i]+3-26);
		}
	}
}
void use2(){
	for(int i=l-1;i>=0;i--){
		b[l-1-i]=a[i];
	}
	a=b;
}
void use3(){
	for(int i=0;i<l;i++){
		if(a[i]>='A'&&a[i]<='Z'){
			a[i]+=32;
		}
		else{
			a[i]-=32;
		}
	}
}
int main(){
	cin>>a;
	use1();
	use2();
	use3();
	cout<<a;
	return 0;
}
2023/9/1 21:18
加载中...