怎样实现这样的循环?代码如下,求指教,谢谢
public double DWfromM() {if(t<=30)
{
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=60)
{
int k;
k=60-t;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=90)
{
int k;
k=t-60;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=120)
{
int k;
k=120-t;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=150)
{
int k;
k=t-120;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=180)
{
int k;
k=180-t;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=210)
{
int k;
k=t-180;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=240)
{
int k;
k=240-t;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=270)
{
int k;
k=t-240;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=300)
{
int k;
k=300-t;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=330)
{
int k;
k=t-300;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=360)
{
int k;
k=360-t;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=390)
{
int k;
k=t-360;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=420)
{
int k;
k=420-t;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=450)
{
int k;
k=t-420;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=480)
{
int k;
k=480-t;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=510)
{
int k;
k=t-480;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=540)
{
int k;
k=540-t;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=570)
{
int k;
k=t-540;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=600)
{
int k;
k=600-t;
DWGeneration += (Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
else if(t<=630)
{
int k;
k=t-600;
DWGeneration +=(Math.exp(workedDAreaGrowthM * t) - DWGeneration;
t++;
}
return DWGeneration;
}