Skip to content

Instantly share code, notes, and snippets.

@Yi-Tseng
Created September 7, 2012 09:12
Show Gist options
  • Save Yi-Tseng/3664527 to your computer and use it in GitHub Desktop.
Save Yi-Tseng/3664527 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, const char * argv[])
{
int r,c;
char* a = "vs lbh pna frr guvf zrffntr, jrypbzr gb wbva gghpfp!";
for(r=1;r<26;r++){
for(c=0;c<strlen(a);c++){
if(isalpha(a[c])){
int t = a[c]-'a';
t = (t+r)%26;
t = t+'a';
printf("%c",t);
}else{
printf("%c",a[c]);
}
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment