C language answer: using the formula: π / 4 = 1-1 / 3 + 1 / 5-1 / 7 + And find the approximate value of π until the absolute value of the last term is less than 10-6 Using the formula: π / 4 = 1-1 / 3 + 1 / 5-1 / 7 + , find the approximate value of π, until the absolute value of the last term is less than 10-6 & nbsp; the following is what I wrote, and the running shows that Pi is 4.0 million, which is obviously wrong #include<stdio.h>#include<math.h>void main(){double s=0,pi,t,d,c;int i,n,j=1;for(i=2,n=1;fabs(1/n)>pow(10,-6);i++,n+=2)s=s+pow(-1,i)*j/n;printf("%f\n",s);printf("pi=%f\n",pi=s*4);} #include #include void main() { double s=0,pi,t,d,c; int i,n,j=1; for(i=2,n=1;fabs(1/n)>pow(10,-6);i++,n+=2) s=s+pow(-1,i)*j/n; printf("%f\n",s); printf("pi=%f\n",pi=s*4); }

C language answer: using the formula: π / 4 = 1-1 / 3 + 1 / 5-1 / 7 + And find the approximate value of π until the absolute value of the last term is less than 10-6 Using the formula: π / 4 = 1-1 / 3 + 1 / 5-1 / 7 + , find the approximate value of π, until the absolute value of the last term is less than 10-6 & nbsp; the following is what I wrote, and the running shows that Pi is 4.0 million, which is obviously wrong #include<stdio.h>#include<math.h>void main(){double s=0,pi,t,d,c;int i,n,j=1;for(i=2,n=1;fabs(1/n)>pow(10,-6);i++,n+=2)s=s+pow(-1,i)*j/n;printf("%f\n",s);printf("pi=%f\n",pi=s*4);} #include #include void main() { double s=0,pi,t,d,c; int i,n,j=1; for(i=2,n=1;fabs(1/n)>pow(10,-6);i++,n+=2) s=s+pow(-1,i)*j/n; printf("%f\n",s); printf("pi=%f\n",pi=s*4); }


#Include & lt; stdio. H & gt; # include & lt; math. H & gt; void & nbsp; main() {double & nbsp; s = 0, PI, t, D, C; double & nbsp; I, N, j = 1; & nbsp; / / all are modified to double for (I = 2, n = 1; Fabs (1 / N) & gt; pow (10, - 6); I + +, N + = 2) s = S + pow (- 1, I) * J / N



Write C language program to calculate the sum of S = 1 + 1 / 2! + 1 / 3!... 1 / N


#include
int main(void)
{
int n=0,i=0;
double p=1,q=0,s=0;
printf("n=");
scanf("%d",&n);
for(i=1;i



Calculate the value of piecewise function. Calculate the value of Y in the following expression according to the input value of X. it is a C language programming problem
 


#include
int main()
{
\x09float x,y;
\X09printf ("please enter the value of X");
\x09scanf("%f",&x);
\x09if(x>-1)
\x09{
\x09\x09printf("y=2x,y=%f\n",2*x);
\x09}
\x09else if(x==-1)
\x09{
printf("y=3\n");
\x09}
\x09else if(x



The natural numbers 1,2,3 999 in a number n = 12345 998999, find the sum of the numbers of n
Please write down the detailed answer process


13500
You may as well add "00" to the first digit and "0" to the second digit, so that the 1000 numbers from 1 to 999 are all "three digits"
It is easy to know that among the 3000 numbers in 1000, the numbers 0 to 9 appear 300 times the same, and the added "0" does not affect the sum of the numbers
So the sum of the numbers
= 300×(0+ 1+2+3+…… 9)
= 300×45
= 13500



Solving inequality | X & # 178; - 9 | 10x


Absolute value term is constant and nonnegative, x0 (X & # 178; + 10x-9) (X & # 178; - 10x-9) > 0 [(x + 5) & # 178; - 34] [(X-5) & # 178; - 34] > 0 (x + 5 + √ 34) (x + 5 - √ 34) (X-5 + √ 34) (X-5 - √ 34) > 0x ≥ 0, x + 5 + √ 34 > 0, X-5 + √ 34 > 0 (x + 5 - √ 34) (X-5 - √ 34) > 0x > 5 + √ 34 or X5 + √ 34 or 0 ≤ X5 + √



In order to advocate water saving, a city stipulates that the monthly water consumption standard of each household is 8 times 8 times 8 meters (the cube of 8 can not be found), and the charge for the part exceeding the standard is increased. It is known that the water consumption and water charge of a household in a two-month period are 11 times 11 times 11 meters, 28 yuan and 15 times 15 times 15 meters, 44 yuan respectively. What are the water prices in the standard and the part exceeding the standard?


Set the price of water per cubic meter in the standard as X Yuan, and the price of water per cubic meter in excess of the standard as y yuan
Get the equation from the meaning of the question
8x + (11-8)y=28
8x + (15-8)y=44
The solution is x = 2, y = 4



The formula of distance from point to line


Straight line (general formula): ax + by + C = 0 coordinates (XO, yo), then the distance from this point to this straight line is the absolute value of (axo + BYO + C) divided by the root sign (the square of a plus the square of B)



If the positive real number 2A + B = 4 is known, then the maximum value of AB is


B = 4-2a AB = a (4-2a) = - 2 (a ^ 2-2a) = - 2 [(A-1) ^ 2-1] has a maximum value of 2 when a = 1



How to solve the differential equation x ^ 3 (dy / DX) + 2Y ^ 2 = 0?


x^3(dy/dx)+2y^2=0
x^3(dy/dx)=-2y^2
When y is not 0
-dy/y^2=2dx/(x^3)
Integral on both sides at the same time
-1/y=1/x^2+c
y= -1/(C + 1/x^2)
The equation holds for y = 0



A simple plane vector... Thank you
Three points a (1,2) B (3, - 2) C (9,7) in the right angle plane, if e and F are the trisection points of line segment BC, then the scalar product of vector AE and vector AF is?


BC = (6,9), 1 / 3bC = (2,3), so e is (2 + 3,3 + (- 2)), i.e. (5,1), f is (9-2,7-3), i.e. (7,4),
So AE = (4, - 1), AF = (6,3),
The product of AE and AF is 4 * 6 + (- 1) * 3 = 21