24 lines
377 B
C
24 lines
377 B
C
|
#include <stdio.h>
|
||
|
|
||
|
// Declare prototypes
|
||
|
int process(char c);
|
||
|
|
||
|
int main(void) {
|
||
|
int temp;
|
||
|
|
||
|
while ((temp = getc(stdin)) != '\n') {
|
||
|
printf("%c", process(temp));
|
||
|
}
|
||
|
printf("\n");
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
int process(char c) {
|
||
|
if (c >= 'a' && c <= 'z') { // If c is a - z
|
||
|
return (c - 'a' + 3) % 26 + 'a';
|
||
|
}
|
||
|
else
|
||
|
return (c - 'A' + 3) % 26 + 'A'; // Else if c is A - Z
|
||
|
}
|