/ Vijos /

记录详情

Compile Error

foo.cpp:1:1: error: 'include' does not name a type
 include<bits/stdc++.h>
 ^~~~~~~
foo.cpp: In function 'int main()':
foo.cpp:3:154: error: 'cin' was not declared in this scope
 using namespace std;const double pi=3.141592653579;double r,x[200],y[100],ans;int n;double distant(double x1,double y1,double x2,double y2);int main() { cin>>n>>r; ans=2*r*pi; for (int i=1; i<=n; i++) { cin>>x[i]>>y[i]; } x[0]=x[n]; y[0]=y[n]; for (int i=1; i<=n; i++) { ans+=distant(x[i],y[i],x[i-1],y[i-1]); } printf("%.2f\n",ans);}double distant(double x1,double y1,double x2,double y2) { return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}
                                                                                                                                                          ^~~
foo.cpp:3:332: error: 'printf' was not declared in this scope
 using namespace std;const double pi=3.141592653579;double r,x[200],y[100],ans;int n;double distant(double x1,double y1,double x2,double y2);int main() { cin>>n>>r; ans=2*r*pi; for (int i=1; i<=n; i++) { cin>>x[i]>>y[i]; } x[0]=x[n]; y[0]=y[n]; for (int i=1; i<=n; i++) { ans+=distant(x[i],y[i],x[i-1],y[i-1]); } printf("%.2f\n",ans);}double distant(double x1,double y1,double x2,double y2) { return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}
                                                                                                                                                                                                                                                                                                                                            ^
foo.cpp: In function 'double distant(double, double, double, double)':
foo.cpp:3:436: error: 'sqrt' was not declared in this scope
 using namespace std;const double pi=3.141592653579;double r,x[200],y[100],ans;int n;double distant(double x1,double y1,double x2,double y2);int main() { cin>>n>>r; ans=2*r*pi; for (int i=1; i<=n; i++) { cin>>x[i]>>y[i]; } x[0]=x[n]; y[0]=y[n]; for (int i=1; i<=n; i++) { ans+=distant(x[i],y[i],x[i-1],y[i-1]); } printf("%.2f\n",ans);}double distant(double x1,double y1,double x2,double y2) { return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}
                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^

信息

递交者
类型
递交
题目
P1007 绕钉子的长绳子
语言
C++
递交时间
2017-02-25 14:57:48
评测时间
2017-02-25 14:57:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes