Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char shiftAlphaCharacter(char c, int n) {
- if ((c >= 65 and c <= 90)) {
- if (n > 25) {
- n = n % 25;
- }
- c = c + n;
- if (c > 90) {
- c = c - n;
- int diff;
- diff = n - (90 - c) - 1;
- c = 65 + diff;
- }
- }
- else if ((c >= 97 and c <= 122)) {
- if (n > 25) {
- n = n % 25;
- }
- c = c + n;
- if (c > 122) {
- c = c - n;
- int diff;
- diff = n - (122 - c) - 1;
- c = 97 + diff;
- }
- }
- return c;
- }
- int main() {
- cout << shiftAlphaCharacter('x', 33);
- return 0;
- }
- console cout's 'Ç'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement