#include <iostream>
using namespace std;
int main()
{
int sum=0,Rows =3;
int rotor[10][Rows];
int keyword[Rows];
string code ="7436";
int stepsize =2;
keyword[0] =4;
keyword[1] =5;
keyword[2] =6;
//keyword[3] =9;
//keyword[4] =9;
for (int x =0 ;x<10;x++)
{
for (int y= 0; y<Rows; y++)
{
rotor[x][y] = 0;
//cout<<rotor[x][y];
}
//cout<<endl;
}
//cout<<endl;
string Last;
for (int i =0 ;i<code.length() ;i++)
{
if (i+1<2)
{
sum=0;
for ( int x =0 ; x<Rows ; x++)
{
Last =" ";
sum = sum + keyword[x] ;
cout<<sum<<" sum of the keyword"<<endl;
Last = to_string(sum);
rotor[0][x] = Last[Last.length()-1]-'0';
//cout<<rotor[0][x];
}
cout<<endl;
int y =0;
for (int r= 0 ;r<Rows ;r++)
{
y=0;
for ( int val =rotor[0][r] +1; val<10;val++)
{
y++;;
rotor[y][r] = val;
}
for (int val = 0 ; val<rotor[0][r] ;val++)
{
y++;
rotor[y][r] = val;
}
}
cout<<endl;
for (int x =0;x<10 ;x++)
{
for (int y =0 ; y <Rows ;y++)
{
cout<<rotor[x][y];
}
cout<<endl;
}
keyword[0] = keyword[0] + stepsize;
cout<<keyword[0]<<" keyword of new iteration under 2"<<endl;
}
else
{
sum=0;
for ( int x =0 ; x<Rows ; x++)
{
Last =" ";
sum = sum + keyword[x] ;
cout<<sum<<" sum of the keyword"<<endl;
Last = to_string(sum);
rotor[0][x] = Last[Last.length()-1]-'0';
//cout<<rotor[0][x];
}
cout<<endl;
int y =0;
for (int r= 0 ;r<Rows ;r++)
{
y=0;
for ( int val =rotor[0][r] +1; val<10;val++)
{
y++;;
rotor[y][r] = val;
}
for (int val = 0 ; val<rotor[0][r] ;val++)
{
y++;
rotor[y][r] = val;
}
}
cout<<endl;
for (int x =0;x<10 ;x++)
{
for (int y =0 ; y <Rows ;y++)
{
cout<<rotor[x][y];
}
cout<<endl;
}
keyword[0] = keyword[0] + stepsize;
keyword[1] = rotor[0][1] ;
keyword[2] = rotor[0][2] ;
cout<<keyword[0]<<" keyword of new iteration above 2"<<endl;
cout<<keyword[1]<<" keyword of new iteration above 2"<<endl;
cout<<keyword[2]<<" keyword of new iteration above 2"<<endl;
}
}
return 0;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}