请老师大侠帮助 理解
下面的代码 最后运行结果是 1 至 10 的每个数字的 平方 表
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace pingfang{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 10; i++)
{
Console.WriteLine("{0}的平方为:{1}",i,squarer(i));
}
Console.ReadLine();
}
static int squarer(int x)
{
int j = 0;
j = x * x;
return j;
}
}
}
---------------------
不理解为什么要加下面的代码?
static int squarer(int x)
{
int j = 0;
j = x * x;
return j;
}
先拜谢热心的老师的帮教!!!


