|
|
вернуться в форумWA#15 Where is the error in my code? Please, help... #include <stdio.h> #include <conio.h> #include <math.h> int main() { float l, h, w, n, t; scanf("%f%f%f", &l, &h, &w);
h /= 100; l /= 100; w /= 60;
h -= l/2; t = sqrt(2*h/9.81); n = t*w; n -= (int) n; if(n <= 0.25 || n >= 0.75) printf("butter"); else printf("bread");
return 0; } Re: WA#15 The first change float to double and respectivly change scanf like this double l, h, w, n, t; scanf("%lf%lf%lf", &l, &h, &w); and add the case if( l/2>h ){ printf("butter"); return 0; } and your get AC Re: WA#15 Sorry I didnot sea that your allready have AC on this problem 20:49:45 12 мар 2012 |
|
|