请问蚂蚁爬绳子的问题? 绳子长100厘米,并且以10厘米/秒的速度均匀拉伸(起点固定,终点拉伸)蚂蚁从起点向终点方向爬,相对绳子的速度是1厘米/秒请问蚂蚁最终能爬到绳子终点吗?如果能爬到,需要多长时间呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 float f_ropeLenth = 100;float f_ropeStep = 10;float f_antStep = 1;int n_Timer;int GetTimeToEnd(float antStep,float ropeStep,float ropLenth){ int Timer = 0; float ant = 0; float EndPoint; while(ant >= ropLenth) { EndPoint = ropLenth - ant; ropLenth += ropeStep; ant = (EndPoint/ropLenth)*ropStep + antStep; Timer++; } return Timer;} 错误while(ant<=ropLenth) 错误, ant = (ant/ropLenth)*ropStep + antStep;汗,取消解答 看了半天,原来答案是错误的阿这个题目特别繁琐,估计少有人能够解算出来。希望CSDN有真正的高手出现。 人脸识别:特征提取维数问题 CFrameWnd返回-1 怎么解决哦? 请问在VC中如何将ASCII码转成字符? IE 下载的一个问题! 急!! 怎样才能在xp下调试控制台程序时,dos窗口运行完成后不关闭呢 关于最基本的服务器监听的程序`` 借人气,问问这里的水友,看别人的程序代码有何便捷有效的方法? 如何把串口缓冲区中的变长数据全部读出并随之进行处理? 谁能给个direct8.1 sdk的下载地址?!---come on 如何用editbox显示路径? RC1015是什么问题? 使用ADO保存和读取SQL Server BLOB 数据的问题
float f_ropeLenth = 100;
float f_ropeStep = 10;
float f_antStep = 1;
int n_Timer;
int GetTimeToEnd(float antStep,float ropeStep,float ropLenth)
{
int Timer = 0;
float ant = 0;
float EndPoint;
while(ant >= ropLenth)
{
EndPoint = ropLenth - ant;
ropLenth += ropeStep;
ant = (EndPoint/ropLenth)*ropStep + antStep;
Timer++;
}
return Timer;
}
while(ant<=ropLenth)