|
|
вернуться в форумplease help!why wa on test 5? Послано holtaf 15 ноя 2010 00:10 #include<vector> #include<iostream> #include<math.h> using namespace std; int main() { vector<double>x; vector<double>y; int n; double r,t; cin>>n>>r; for(int i=0;i<n;i++) { cin>>t; x.push_back(t); cin>>t; y.push_back(t); } int j; double length=0; for(j=0;j<n;j++) { length+=sqrt(pow(x[j+1]-x[j],2)+pow(y[j+1]-y[j],2)); } length+=sqrt(pow(x[j]-x[0],2)+pow(y[j]-y[0],2)); double pi=3.14; length+=r*pi*2; cout<<length; return 0; } |
|
|