C++ Print Cascading Alphabet Table (Vigenere Square)

email me

In cryptography, the tabula recta (from Latin tabula rēcta) is a square table of alphabets, each row of which is made by shifting the previous one to the left. The term was invented by the German author and monk Johannes Trithemius in 1508, and used in his Trithemius cipher. (wiki)

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <iostream>
#include <string>

int main()
{
int a[26], aux, al = 65;

using std::string;

for (int i = 0; i<26; i++)
{
a[i] = al;
al++;
}

while (true) {
for (int j = 0; j < 26; j++)
{
printf("%c ", a[j]);
}
printf("\n");

for (int k = 0; k < 25; k++)
{
aux = a[k];
a[k] = a[k + 1];
a[k + 1] = aux;
}
if (a[0] == 65)
{
break;
}
}

std::cin.get();
return 0;

}

Output

Notes

https://en.wikipedia.org/wiki/Tabula_recta
https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher