You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include "rot13.h"
|
|
|
|
void rot13(char* in)
|
|
{
|
|
char* end = in + strlen(in);
|
|
for (char* c = in; c < end; c++) {
|
|
if (*c >= 'a' && *c <= 'z') {
|
|
*c += (*c < 'n') ? 13 : -13;
|
|
continue;
|
|
}
|
|
if (*c >= 'A' && *c <= 'Z') {
|
|
*c += (*c < 'N') ? 13 : -13;
|
|
}
|
|
}
|
|
}
|