告急!!!!!!!!!!!!!!! 并非所有的代码路径都返回值
我这里有一行简单的代码,可总是编译失败(失败的原因:(并非所有的代码路径都返回值)),求高手指点一下
using System;
class grades
{
public double[] grad = new double[12];
grades()
{
Console.WriteLine("请输入12个学生的分数");
for (int i = 0; i <= 11; i++)
{
Console.WriteLine("grad[" + i + "]=");
grad[i] = double.Parse(Console.ReadLine());
}
}
static double jiafa (double[] grad)
{
string str="";
for (int i = 0; i <= 11; i++)
{
grad[i] = grad[i] + 7;
str = string.Format("grad[i]={0}", grad);
}
Console.WriteLine(str);
}
public static void Main()
{
grades g1 = new grades();
}
}