编写一个C#程序,输出以下信息。 ********** Very Good **********
时间: 2024-03-11 09:43:02 浏览: 26
要编写一个C#程序输出以上信息,你可以使用Console.WriteLine()函数来实现。以下是一个示例程序:
```csharp
using System;
class Program
{
static void Main()
{
Console.WriteLine("**********");
Console.WriteLine("Very Good");
Console.WriteLine("**********");
}
}
```
这个程序会在控制台输出所需的信息。你可以将以上代码复制到一个C#文件中,然后编译并运行该程序,即可看到输出结果。
相关问题
编写一个C#程序输出*****verygood*****
要编写一个C#程序输出"*****verygood*****",可以使用Console.WriteLine()方法来实现。以下是一个简单的示例代码:
```csharp
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("*****verygood*****");
}
}
```
这个程序会在控制台输出"*****verygood*****"。你可以将以上代码保存为一个.cs文件,然后使用C#编译器编译运行该程序。
用C#语言编写一个5*5魔方阵
好的,以下是用C#语言编写一个5*5魔方阵的代码:
```csharp
using System;
class MagicSquare
{
static void Main()
{
int[,] magicSquare = new int[5,5];
int number = 1;
int row = 0;
int column = 2;
magicSquare[row, column] = number;
while (number < 25)
{
number++;
row--;
column++;
if (row < 0 && column > 4)
{
row += 2;
column--;
}
else if (row < 0)
{
row = 4;
}
else if (column > 4)
{
column = 0;
}
if (magicSquare[row, column] != 0)
{
row += 2;
column--;
}
magicSquare[row, column] = number;
}
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
Console.Write("{0,2} ", magicSquare[i,j]);
}
Console.WriteLine();
}
}
}
```
运行该程序,即可输出一个5*5的魔方阵。