Posted By

donfips on 10/13/10


Tagged


Versions (?)

rot13


 / Published in: C
 

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. int c,b;
  6.  
  7. while( (c = getchar()) !='\n')
  8. /* Ueberpruefung ub innerhalb 'A-Z' oder 'a-Z' */
  9. if(c < 91 && c > 64 || c < 123 && c > 97){
  10. if(c < 91){
  11. /*Falls c > 91 also > Z % 65 und + 'A'*/
  12. putchar(((c+13)%65)+65);
  13. } else if(c > 97){
  14. putchar(((c+13)%97)+97);
  15. }
  16. } else {
  17. putchar(c);
  18. printf("a\n");
  19. }
  20. return 0;
  21. }

Report this snippet  

You need to login to post a comment.