Skip to content

Instantly share code, notes, and snippets.

@tansly
Created August 4, 2019 14:49
Show Gist options
  • Save tansly/4150c1309c91f8bfc148c685f667fc8d to your computer and use it in GitHub Desktop.
Save tansly/4150c1309c91f8bfc148c685f667fc8d to your computer and use it in GitHub Desktop.
#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