public class BPIH4E6
{
     // main method begins execution of Java application
     public static void main( String args[] )
     {            
        //pi = 4 - 4/3 + 4/5 -4/7+4/9-4/11+...+
        String s;  
        double pi=0;
        int artieksi=-1;
        int i=1;
        while(i < 100000)
        {
        artieksi*=-1;
        pi+=4/(2.0*i-1.0)*artieksi;
        i++;
        }
        s="pi = "+pi;
        System.out.println(s);
     } // end method main
} // end class BPIH4E1
