#include <iostream>
#include <z/all.hpp>
template <int N>
auto rot(uint32_t chr) -> uint32_t {
return ((chr - 'a') + N) % 26 + 'a';
return ((chr - 'A') + N) % 26 + 'A';
}
return chr;
}
const zstring from =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
const zstring to =
"nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM";
int main(int argc, char **argv) {
for (int i = 1; i < argc; ++i) {
str.cipher(rot<13>).write(std::cout);
}
}
A template class for character strings.
Definition string.hpp:62
void write(std::ostream &stream) const noexcept
Write string data to a stream in that stream's encoding.
Definition string.hpp:1496
string cipher(const string &keys, const string &values) const noexcept
Convert this string from one set of characters to another.
void writeln(std::ostream &stream) const noexcept
Write string data to a stream in its format, appending a newline.
Definition string.hpp:1507
bool isLowerAlpha(uint32_t ch) noexcept
Check if the given character is a lowercase alphabetic character.
bool isUpperAlpha(uint32_t ch) noexcept
Check if the given character is an uppercase alphabetic character.