Compare commits

..

6 Commits

Author SHA1 Message Date
ljcjames
0db4fdd6b0 Merge branch 'master' into chao 2022-08-11 22:06:42 +08:00
ljcjames
c168d4f6e0 -1 return 2022-08-11 22:00:07 +08:00
ljcjames
444d4bded9 标记 2022-08-11 21:59:29 +08:00
ljcjames
3e26bbdbda Merge branch 'chao' 2022-08-11 21:57:48 +08:00
ljcjames
703920e2fd 注释 2022-08-11 21:55:46 +08:00
ljcjames
d6de4c2aa4 格式化 2022-08-11 21:53:22 +08:00

View File

@ -7,6 +7,7 @@ const double inf=1e100,EPS=1e-6;
const int W = 20;
double l, now;
int n;
//一道墙
struct wall
{
double x, y[6], val[5];
@ -33,7 +34,8 @@ int sign(double d)
{
return 0;
}
else return d>0? 1:-1;
else
return d > 0 ? 1 : -1;
}
bool ob(int li, int lj, int ri, int rj)
{
@ -65,7 +67,8 @@ void find(int ii,int jj)
w[ii].val[jj] = now;
}
// printf("(%.0lf,%.0lf)(%.0lf,%.0lf):length:%.3lf,now:%.3lf£¬val:%.3lf\n",w[ii].x,w[ii].y[jj],w[i].x,w[i].y[j],l,now,w[ii].val[jj]);
if(i==0) break;
if (i == 0)
break;
}
}
}
@ -76,7 +79,8 @@ void doit()
for (int j = 1; j <= 4; j++)
{
find(i, j);
if(i==n) break;
if (i == n)
break;
}
}
}
@ -85,7 +89,8 @@ int main()
while (1)
{
scanf("%d", &n);
if(n==-1) return 0;
if (n == -1)// 结束
return 0;
memset(&w, 0, sizeof(wall) * (n + 1));
w[0].x = 0;
w[0].y[1] = 5;