Skip to content

Instantly share code, notes, and snippets.

@merbussa
Created April 7, 2014 19:44
Show Gist options
  • Save merbussa/10038620 to your computer and use it in GitHub Desktop.
Save merbussa/10038620 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define ROT 13
int main(void)
{
int c, c_yeni;
while((c = getchar()) != EOF){
if(c >= 'A' && c <= 'Z'){
if((c_yeni = c + ROT) <= 'Z')
putchar(c_yeni);
else{
c_yeni = c - ROT;
putchar(c_yeni);
}
}
else if(c >= 'a' && c <= 'z'){
if((c_yeni = c + ROT) <= 'z')
putchar(c_yeni);
else{
c_yeni = c - ROT;
putchar(c_yeni);
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment