Created
August 4, 2019 14:49
-
-
Save tansly/4150c1309c91f8bfc148c685f667fc8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <ctype.h> | |
using std::string; | |
using std::cin; | |
using std::cout; | |
using std::endl; | |
using std::getline; | |
int main() | |
{ | |
string text; | |
char c; | |
int i, j; | |
getline(cin, text); | |
for (i = 1; i <= 26; i++) { | |
for (j = 0; text[j]; j++) { | |
c = text[j]; | |
if (isalpha(c)) { | |
c -= 'A'; | |
c += i; | |
c %= 26; | |
c += 'A'; | |
} | |
cout << c; | |
} | |
cout << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment