Home > Back-end >  c
c

Time:10-07

C + +,

CodePudding user response:

A general formula coding directly according to the final

CodePudding user response:

Can you specifically, code a bit more intuitive

CodePudding user response:

reference 1/f, small cypress childe response:
directly according to the last general formula coding

I feel I don't understand the question, and if n is 3, is directly into the final formula inside line, and calculate again

CodePudding user response:

reference 4 floor weixin_46338679 response:
Quote: refer to 1st floor small cypress childe response:
directly according to the last general formula coding

I feel I don't understand the question, and if n is 3, is directly into the final formula inside, and then calculate a

No, this formula is all and ah

CodePudding user response:

Part of the people here are not very sensitive in mathematics, the formula you work in the BBS have 1 years experience can write, so to speak, don't know how to understand the mathematical formula is main

CodePudding user response:

refer to 6th floor small cypress childe response:
Quote: refer to 4th floor weixin_46338679 response:
Quote: refer to 1st floor small cypress childe response:
directly according to the last general formula coding

I feel I don't understand the question, and if n is 3, is directly into the final formula inside, and then calculate a

No, this formula is all and ah

Can you put my code for my reference

CodePudding user response:

Double fun (double x, int n)
{
Double cosx=1;
Double d=1;
For (int I=1; I & lt;=n; + + I)
{
D *=(1) * * x (x)/((2 * I - 1) * (2 * I));
Cosx +=d;
}
Return cosx;
}

CodePudding user response:

references 9 f 燚 recognition response:
double fun (double x, int n)
{
Double cosx=1;
Double d=1;
For (int I=1; I & lt;=n; + + I)
{
D *=(1) * * x (x)/((2 * I - 1) * (2 * I));
Cosx +=d;
}
Return cosx;
}

D *=(1) * * x (x)/(2 * I - 1) * (2 * I)) it didn't quite understand,

CodePudding user response:

Every one is equal to it before a multiplied by (1) * * x (x)/((2 * I - 1) * (2 * I))