|
|
back to boardWA 3 or 6 Posted by voral 15 Jun 2011 14:58 Now I have: Input: 10 10 Answer: 10 Input: 13 14.1 Answer: 15 but: float p, q; scanf ("%f %f", &p, &q); p/=100; q/=100; result: WA6 but: float p, q; scanf ("%f %f", &p, &q); p=(float)((int)(p*100))/10000.00; q=(float)((int)(q*100))/10000.00; //Only 2 digits after dot result: WA3 Why? PS (ceil(p*cnt)-((int)(q*cnt)))>1e-7 Re: WA 3 or 6 Use double,don't float |
|
|