问题遇到的现象和发生背景
c++ for 循环
问题相关代码,请勿粘贴截图
double length = 1.0;
for (double i_one = 0.0; i_one < length; i_one = i_one +0.1 )
{
cout<<"i_one:" << i_one << endl;
}
for (double i_two = 0.0; i_two <= length; i_two = i_two + 0.1)
{
cout <<"i_two:" << i_two << endl;
}