|
|
back to boardDiscussion of Problem 1258. Poolthis is really shitty....this program compiles just fine with gcc3.2 why do I get CE #include <stdio.h> #include <math.h> int i,j,n,m,k; int w,d; int main() { int x0,y0,x1,y1; scanf ("%d%d%d%d%d%d",&w,&d,&x0,&y0,&x1,&y1); char c[10000]; scanf ("%s",c); for (i=0;c[i];i++) { if (c[i]=='F') y0=-y0; if (c[i]=='L') x0=-x0; if (c[i]=='B') y0=d+d-y0; if (c[i]=='R') x0=w+w-x0; } double dist=sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1)); printf ("%.4lf\n",dist); return 0; } Re: this is really shitty....this program compiles just fine with gcc3.2 why do I get CE You must replace sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1)); with sqrt((double)((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1))); |
|
|