its only executing the code inside of the if(i==0) and ignoring the one inside if(i==1) there is also if(i==2) but i removed due to post restrictions im new to this but if i can figuere out why its not executing the code inside of the first else if statement i might be able to fix fix both
string[][] friendFamily = new string[][]
{
new string[]{"khzix","rengar","shaco" },
new string[]{"jhin","tf","karma" },
new string[]{"qiyanna","braum","thresh" }
};
for (int i = 0; i < friendFamily.Length; i++)
{
if (i == 0)
{
for (int x = 0; x < friendFamily[i].Length; x++)
{
for (int j = 0; j < friendFamily.Length; j++)
{
if (j == 1 || j == 2)
{
for (int k = 0; k < friendFamily.Length; k++)
{
Console.WriteLine("hey {0} this is {1}.", friendFamily[i][x], friendFamily[j][k]);
}
}
}
}
}
else if (i == 1)
{
for (int x = 0; x < friendFamily[i].Length; x++)
{
for (int j = 0; j < friendFamily.Length; j++)
{
if (j == 0 || j == 2)
{
for (int k = 0; k < friendFamily.Length; k++)
{
Console.WriteLine("hey {0} this is {1}.", friendFamily[i][x], friendFamily[j][k]);
}
}
}
}
}
Aucun commentaire:
Enregistrer un commentaire