1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【额外练习】选择结构/7-34 选择-凯撒密码.c

20 lines
278 B
C

#include <stdio.h>
int main() {
char c;
scanf("%c", &c);
if (c >= 'a' && c <= 'z') {
c += 3;
if (c > 'z') c -= 26;
} else if (c >= 'A' && c <= 'Z') {
c += 3;
if (c > 'Z') c -= 26;
}
printf("%c\n", c);
return 0;
}