#include<stdio.h>
#include<math.h>
int main( )
{
  int x=1;
  double pi=0.0,y=1,z=1;
  while(fabs(z)>=1e-6)
  {
  pi=pi+z;
  y=y+2;
  x=-x;
  z=x/y;
  }
  pi=pi*4;
  printf("pi=%10.8f",pi);
}