if(API>30)
{
double c1 = 0.0178;
double c2 = 1.187;
double c3 = 23.931;
}
else
{
double c1 = 0.0362;
double c2 = 1.0937;
double c3 = 25.7240;
}
double Rs2 = (c1 * sg * Math.Pow(p, c2)) * Math.Exp(c3 * (API / T));
C# 不接受c1
, c2
,c3
在我的代码中定义为 vars,我该如何解决这个问题?