I think the keyword is not repeating itself. Kindly help!
string p = GetString();
int a;
for (int i=0, n=strlen(p); i<n; i++)
{
if (isupper(p[i]))
{
if (isupper(k[i]))
a = k[i]-65;
else
a = k[i]-97;
int z = a%n;
int b = p[i]-65;
int c = (z+b)%26;
int d = c+65;
printf ("%c", d);
}
else if (islower(p[i]))
{
if (isupper(k[i]))
a = k[i]-65;
else
a = k[i]-97;
int z = a%n;
int b = p[i]-97;
int c = (z+b)%26;
int d = c+97;
printf ("%c", d);
}
else
{
printf ("%c", p[i]);
}
}
printf ("\n");
return 0;