- 绕钉子的长绳子
- 2015-08-21 21:19:32 @
求大神指导:为何程序会出现cc1plus.exe: error: unrecognized command line option '-std=c++11' 这个错误?
程序:
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;
struct data{
float x,y;
}a[110];
int main()
{
int n,i;
float r,tot;
cin>>n>>r;
for (i=1;i<=n;i++)
cin>>a[i].x>>a[i].y;
a[n+1].x=a[1].x;
a[n+1].y=a[1].y;
for (i=2;i<=n+1;i++)
tot+=sqrt(fabs((a[i].x-a[i-1].x)*(a[i].x-a[i-1].x))+fabs((a[i].y-a[i-1].y)*(a[i].y-a[i-1].y)));
tot+=3.14*2*r;
printf("%0.2lf",tot);
}
1 条评论
-
mrw LV 10 MOD @ 2015-08-21 21:45:03
twd2 不小心把评测机玩坏啦。
- 1