+ 1
How to display this table please ?
using System; using System.IO; using System.Linq; using System.Collections.Generic; namespace CSharp_Shell { public static class Program { public static void Main() { string [,] menus = { {"1","Jouer"}, {"2","Paramètres"}, {"3","Quitter"} }; for(int i=0;i<menus.Length;i++) { Console.WriteLine(
quot;{menus[]}"); } } } }2 Answers
+ 6
Do you mean the output like this?
1. Jouer
2. Paramètres
3. Quitter
If so, try the following code.
string [,] menus =
{
{"1","Jouer"},
{"2","Paramètres"},
{"3","Quitter"}
};
int nItems = menus.Length / menus.Rank;
for (int i=0; i<nItems; i++)
{
Console.WriteLine("{0}. {1}", menus[i,0], menus[i,1]);
}
+ 1
đđđ