Skip to content

Instantly share code, notes, and snippets.

@kira924age
Last active August 29, 2015 14:01
Show Gist options
  • Save kira924age/328c19c215f0e5a29a65 to your computer and use it in GitHub Desktop.
Save kira924age/328c19c215f0e5a29a65 to your computer and use it in GitHub Desktop.
Just rot Alphabet.
#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