Last active
August 29, 2015 14:01
-
-
Save kira924age/328c19c215f0e5a29a65 to your computer and use it in GitHub Desktop.
Just rot Alphabet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define key 13 | |
int main() | |
{ | |
char c; | |
while(scanf("%c",&c) != EOF){ | |
if('A' <= c && c <= 'Z' ){ | |
if((c+key) > 'Z') | |
c += (key%26-26); | |
else | |
c += key%26; | |
} | |
else if('a' <= c && c <= 'z'){ | |
if((c+key) > 'z') | |
c += (key%26-26); | |
else | |
c += key%26; | |
} | |
printf("%c", c); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment