33,008
社区成员
发帖
与我相关
我的任务
分享
int fn2(int LtoA)//运到离A点LtoA处剩下的汽油数
{
int nLast=1000;
if(LtoA==0) return 1000;
for(int i=1;i<=LtoA;i++)
{
int ntemp=(nLast%50==0?nLast/50:nLast/50+1);//全进位
nLast= nLast-ntemp*2+1;
}
return nLast;
}