程序: include <math.h> main o f int n=0; float S=0; do{n+=1; S+=pow(-1,n+1)/(2*n-1); whie(1./(2n-1)>=1e-7) printf ("PI=%.\n",4*s);#include <math.h> main() { int n=0; float s=0; do { n+=1; s+=pow(-1,n+1)/(2*n-1); } while ( 1./(2*n-1) >= 1e-7 ); printf(“PI = %.6f\n", 4 * s ); } 程序: