题解 | #密码翻译#

密码翻译

https://www.nowcoder.com/practice/136de4a719954361a8e9e41c8c4ad855

#include <stdio.h>
#include <string.h> 
#include <math.h>
#include <string.h> 
#include <stdlib.h>

#define MAX 81
int main(){
	char str[MAX];
	gets(str);
	int i = 0;
	while (str[i] != '\0'){
		if ((str[i] >= 'a' && str[i] <= 'y') || (str[i] >= 'A' && str[i] <= 'Y'))
			str[i] = str[i]+1;
		else if (str[i] == 'z' || str[i] == 'Z')
			str[i] -= 25;
		i++;
	}
	printf("%s",str);
}

全部评论

相关推荐

只写bug的程序媛:人家说一本以上,不是及以上
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务