我不明白为什么,这个公式一直有效,直到 Scrap = 51,Rec 应该是 17,而是 16.99。
Scrap = int.Parse(textBoxS.Text);
for (counter = 0; counter < Scrap; textBoxRec.Text = Rec.ToString() )
{
if (Rec == (int)Rec + 0.66)
{
Rec = (int)Rec + 1;
counter++;
}
else
{
Rec = Rec + 0.33;
counter++;
}
}