-3

これは私がこれまでに持っているコードです:

string[] animals = { "cow", "pig", "dog", "cat", "mouse", "giraffe", "moose", "deer", "lion", "hippo" };
Console.WriteLine("{0,5}{1,8}", "animal", "index");
Console.ReadLine();
4

1 に答える 1

5
for(int i = 0; i < animals.length();i++) //Go through the whole array
{
     Console.WriteLine(animals[i] + " " + i); //Output the animal and the index
}
Console.ReadLine();  //Wait for user input.
于 2012-12-09T21:04:28.143 に答える