NameGenerator
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main()
{
string alp[]={"NULL","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
"S","T","U","V","W","X","Y","Z"};
string vov[]={"NULL","A","E","I","O","U"};
string posEnd[]={"NULL","B","C","D","F","G","H","J","K","L","M","N","P","Q","R","S","T","V",
"W","X","Y","Z"};
srand(time(NULL));
int lenAlp,lenVov,lenPosEnd;
int j,i,k,n,l,g;
lenAlp = sizeof(alp)/sizeof(alp[0])-1;
lenVov = sizeof(vov)/sizeof(vov[0])-1;
lenPosEnd = sizeof(posEnd)/sizeof(posEnd[0])-1;
cout<<"Enter max(10) letter for the name: " ;
cin>>g;
n = g;
if(g!=3)
{
if(n%2==0)
{
n=(n/2)+1;
}else{
n=(n/3)+2;
}
}else{
n=2;
}
l = rand()%lenPosEnd+1;
if(n<2||n>6)
{
cout<<"invalid number min(2) max(10)!";
}else{
for(k=0;k<n-1;k++)
{
i = rand()%lenAlp+1;
j = rand()%lenVov+1;
if(i==j)
{
i = 1;
j = 4;
cout << alp[i]<<vov[j]<<"\n";
cout<<"Same found";
}else{
cout << alp[i]<<vov[j];
}
}
if(g%2==0)
{
}else{
cout <<posEnd[l];
}
}
return 0;
}