用C#编一个程序 谁帮我一下

来源:百度知道 编辑:UC知道 时间:2024/05/17 03:44:39
编写一个程序:
计算从0~10的数字的平方和三次方
并以表格形式输出

形式如:
number square cube
0 0 0
1 1 1
2 4 8
……………………

using System;

namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
Console.WriteLine("Number\tSquare\tCube");
for(int i=1;i<=10;i++)
{
Console.WriteLine(i+"\t"+i*i+"\t"+i*i*i);
}
Console.WriteLine("Press any key to continue...");
Console.Read();
}
}
}