OOO
OXO
OOO
我的代码:
static private void printArr(ref byte tail, byte[]bitmask)
{
for (int i = 0; i < 3; i++)
{
Console.Write('\n');
for (int j = 0; j < 3; j++)
{
if (change(cas, bitmask[i]) == true)
{
Console.Write('O');
}
else
Console.Write('X');
}
}
}
答案 0 :(得分:-1)
using System;
class Program
{
static void Main()
{
string[] arr = new string[4]; // Initialize
arr[0] = "uno"; // First element
arr[1] = "dos"; // Second
arr[2] = "tres"; // Third
arr[3] = "cuatro"; // Fourth
// Loop over strings
for (int i = 0; i < arr.Length; i++)
{
string s = arr[i];
Console.WriteLine(s);
}
// Bonus: Loop over strings backwards
for (int i = arr.Length - 1; i >= 0; i--)
{
string s = arr[i];
Console.WriteLine(s);
}
}
}
输出
uno
dos
tres
cuatro
cuatro
tres
dos
uno