大佬10分求助!呜呜呜
查看原帖
大佬10分求助!呜呜呜
130260
TheTrisomic楼主2023/10/13 23:23

如题 样例能过

#include<stdio.h>
#include<cstring>
#include<string.h>
#include<cstdio>
using namespace std;

int main()
{
	char a[10001]; 
	int i=0;
	fgets(a,10001,stdin);
	
	int n=0;
	n=strlen(a);
	for(int i=0;i<n;i++)
	{
		if(a[i]>65&&a[i]<=90)
		{
			a[i]-=1;
			printf("%c",a[i]);
			continue;
		} 
		else if(a[i]=='A')
		{
			a[i]='Z';
			printf("%c",a[i]);
			continue;
		}
		
		if(a[i]>97&&a[i]<=124)
		{
			a[i]-=1;
			printf("%c",a[i]);
			continue;
		} 
		else if(a[i]=='a')
		{
			a[i]='z';
			printf("%c",a[i]);
			continue;
		}
		printf("%c",a[i]);
	}
	return 0;
}
                              
2023/10/13 23:23
加载中...