|  | 
|  | 
| back to board | What's wrong with my formula?! Posted by Alexey  25 Jun 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?! Posted by Sid  25 Jun 2006 18:06Precision is main trouble of this problem =)OK, but I don't Use real types... Can U give me the test to improve my program? Posted by Alexey  25 Jun 2006 18:26Re: OK, but I don't Use real types... Can U give me the test to improve my program? Posted by Sid  25 Jun 2006 22:20I 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! Posted by Alexey  26 Jun 2006 11:34Re: But I read String! Posted by Sid  26 Jun 2006 11:47Just give me your e-mail and I'll send you c++ source.Re: But I read String! Posted by Alexey  26 Jun 2006 14:31I 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
 | 
 | 
|