|
|
вернуться в форумWhat's wrong with my formula?! Послано Alexey 25 июн 2006 13:59 Readln(n); Readln(ss); delete(ss,pos('.',ss),1); Val(ss,s,r); Readln(ss); delete(ss,pos('.',ss),1); Val(ss,l,r); count:=(s div l)*n+((s mod l)*n) div l+1; Please... Re: What's wrong with my formula?! Послано Sid 25 июн 2006 18:06 Precision is main trouble of this problem =) OK, but I don't Use real types... Can U give me the test to improve my program? Послано Alexey 25 июн 2006 18:26 Re: OK, but I don't Use real types... Can U give me the test to improve my program? Послано Sid 25 июн 2006 22:20 I will try to explain... When you read real number, for example 1.115, after reading you can get something like 1.11499999, and after custing to integer you'll get 1114 instead 1115. Just try different tests. But I read String! Послано Alexey 26 июн 2006 11:34 Re: But I read String! Послано Sid 26 июн 2006 11:47 Just give me your e-mail and I'll send you c++ source. Re: But I read String! Послано Alexey 26 июн 2006 14:31 I don't need your code! I want to understand mistake in my formula! Well. OK, Ok... you've talked me in :) _magistr.90@mail.ru |
|
|