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.
16 lines
283 B
16 lines
283 B
2 years ago
|
#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;
|
||
|
}
|
||
|
}
|
||
|
}
|