回复前请计算自己得分~~~~哈哈哈
int nFloor = 0;//楼数
int i = 10;
int nPoints = 100;
int nYourPoints;
while(nPoints != 0)
{
nYourPoints = nPoints/i++;
nPoints -= nYourPoints;//当前得分
nFloor++;//当前楼数
if( nPoints == i)
{
i = 10;
}
}1。根据自己楼数计算得分,算错不得分。
2。1人限两次机会
int nFloor = 0;//楼数
int i = 10;
int nPoints = 100;
int nYourPoints;
while(nPoints != 0)
{
nYourPoints = nPoints/i++;
nPoints -= nYourPoints;//当前得分
nFloor++;//当前楼数
if( nPoints == i)
{
i = 10;
}
}1。根据自己楼数计算得分,算错不得分。
2。1人限两次机会
int i = 10;
int nPoints = 100;
int nYourPoints;
while(nPoints != 0)
{
nYourPoints = nPoints/i++;//当前得分
nPoints -= nYourPoints;
nFloor++;//当前楼数
if( nPoints == i)
{
i = 10;
}
if( nPoints < i)
{
i = nPoints/2;
}
}
从我这里开始 。从新算分。。嘿嘿。。从第3楼开始记分。。呵呵
该问题已经结贴 ,得分记录: laiyiling(100)
该问题已经结贴 ,得分记录: taianmonkey(100)
while(nPoints != 0)
{
nYourPoints = nPoints/i++;
nPoints -= nYourPoints;//当前得分
nFloor++;//当前楼数
if (nFloor == 27)
{
char aa[3]="";
_itoa(nYourPoints,aa,10);
AfxMessageBox(CString(aa));
return ;
}
if( nPoints == i)
{
i = 10;
}
}
你的程序好HIGH,俺没看懂~~~~~~~~~~~~~~~~~~~