All pastes #636895 Raw Edit

Stuff

public text v1 · immutable
#636895 ·published 2007-07-28 09:59 UTC
rendered paste body
#include <stdio.h>
#include <string.h>

char rot13_enCrypt(char *);
char rot13_enCrypt(char *Message) {
	
	int loops;
	for(loops = 0; loops <= strlen(Message); loops++) {
		int nr;
		if((nr = (int)Message[loops])  <= 90 && nr >= 65) 
			// So this means the char we are crypting is uppercase char
			// We are also checking if the range is against A-Z
			printf("%c",(char)(nr <= 77 ? nr+13 : nr-13));
		      else if(nr >= 97 && nr <= 122)
		    	  printf("%c",(char)(nr <= 109 ? nr+13 : nr-13));
		      else
		    	  printf("%c",(char)nr); // So it wasnt A-Za-z
	}
	return 0;
}

int main() {
	char wtf[] = ""
			"How can you tell an extrovert \n"
			"from an introvert at NSA? Va gur \n"
			"ryringbef,gur rkgebireg ybbxf ng gur \n"
			"BGURE thl'f fubrf. \n";
	int a = rot13_enCrypt(wtf);
	return 0;
}