ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1020. Rope

Why my program got CE?
Posted by Nothing 8 Jun 2002 11:11
// Timus 1020
#include "iostream.h"
#include "math.h"

void main()
{
  int i,n;
  double r,L,x[100],y[100];
  cin>>n>>r;
  for (i=1;i<=n;i++)
  { cin>>x[i]>>y[i];}
  x[0]=x[n]; y[0]=y[n];
  L=0;
  for (i=0;i<n;i++)
  { L+=(sqrt(pow(x[i]-x[i+1],2)+pow(y[i]-y[i+1],2)));
  }
  L+=2*r*M_PI;
  cout.precision(2);
  cout<<L;
}
#include<iostream.h>, i mean < >(-)
Posted by Miguel Angel 8 Jun 2002 12:58
> // Timus 1020
> #include "iostream.h"
> #include "math.h"
>
> void main()
> {
>   int i,n;
>   double r,L,x[100],y[100];
>   cin>>n>>r;
>   for (i=1;i<=n;i++)
>   { cin>>x[i]>>y[i];}
>   x[0]=x[n]; y[0]=y[n];
>   L=0;
>   for (i=0;i<n;i++)
>   { L+=(sqrt(pow(x[i]-x[i+1],2)+pow(y[i]-y[i+1],2)));
>   }
>   L+=2*r*M_PI;
>   cout.precision(2);
>   cout<<L;
> }
>
Re: #include<iostream.h>, i mean < >(-)
Posted by Nothing 10 Jun 2002 19:11
Thanks.
But there isn't this problem.
Have u tested with n=1?
Posted by Zahid Munir Kallal 17 Aug 2003 13:49