为啥有一个点没过……

#include<cstdio>

#include<cmath>

#include<cstdlib>
#define pi 3.141592653
int main()

{

double Circum,R,x0,y0,x1,y1,x,y;

int n,i;

scanf("%d %lf",&n,&R);

scanf("%lf %lf",&x0,&y0);

x1 = x0;

y1 = y0;

for (i=1; i<n; i++)

{

scanf("%lf %lf",&x,&y);

Circum+=hypot(x-x1,y-y1);

x1 = x;

y1 = y;

}

Circum+=hypot(x-x0,y-y0);

Circum+=pi*2*R;

printf("%.2lf",Circum);
//system("pause");

return 0;

}

0 条评论

目前还没有评论...

信息

ID
1007
难度
5
分类
模拟 点击显示
标签
(无)
递交数
12244
已通过
4327
通过率
35%
被复制
27
上传者