Home > Back-end >  Please, help me solve the
Please, help me solve the

Time:10-03

CodePudding user response:

 

# include

Int jiec (int n);//class
Float cifang (float x, int n);//power
Float jishu (float x, int n);//series
Int main ()
{
int i=0;

Printf (" % f \ n ", jishu (0.3, 10));
return 0;
}

Int jiec (int n)//class X!
{
If (n==1)
{
return 1;
}
The else
{
Return jiec n * (n - 1);
}
}
Float cifang (float x, int n)//power of x * * n
{
If (n==1)
{
return x;
}
The else
{
Return the x * cifang (x, n - 1);
}
}
Float jishu (float x, int n)
{
The static float sum=0.0;
If (n==0)
{
The return of 1.0;
}
Else if (n==1)
{
Return the sum + x + 1.0;
}
The else
{
Return the sum + cifang (x, n)/jiec (n) + jishu (x, n - 1);
}
}




If you can remember to points:


CodePudding user response:

The
reference 1/f, like to do in my reply:
 

# include

Int jiec (int n);//class
Float cifang (float x, int n);//power
Float jishu (float x, int n);//series
Int main ()
{
int i=0;

Printf (" % f \ n ", jishu (0.3, 10));
return 0;
}

Int jiec (int n)//class X!
{
If (n==1)
{
return 1;
}
The else
{
Return jiec n * (n - 1);
}
}
Float cifang (float x, int n)//power of x * * n
{
If (n==1)
{
return x;
}
The else
{
Return the x * cifang (x, n - 1);
}
}
Float jishu (float x, int n)
{
The static float sum=0.0;
If (n==0)
{
The return of 1.0;
}
Else if (n==1)
{
Return the sum + x + 1.0;
}
The else
{
Return the sum + cifang (x, n)/jiec (n) + jishu (x, n - 1);
}
}




If you can remember to integral oh

This is the method of function calls

CodePudding user response:

Function is to write their own ah, didn't call what method, using the recursive call

CodePudding user response:

references like to do in my reply: 3/f
function were written yourself, don't call what method, using the recursive call

Key those symbols I can't understand you write ah, haven't we write the

CodePudding user response:

Float the static int return in addition to these keywords, the other is the name of the definition, can be decided casually

CodePudding user response:

refer to fifth floor like to do in my reply:
float static int return in addition to these keywords, the other is the definition of his own name, you can literally make

Yeah, you said that we haven't learned

CodePudding user response:

Under the Internet, are the basic types and keywords, will use later on

CodePudding user response:

# include
using namespace std;
# define mint long long int
Mint n, m, ans;
Bool congrauat [10001].
Struct u {
Mint x, y;
//x and y for friends
};
U nccop [10001];//input necessary
Bool CMP (u, u j) {
Return (i.x & lt; I.y)? 1-0.//order
}
Int main () {
//freopen (" friendscircle. In ", "r", stdin);//freopen
//freopen (" friendscircle. Out ", "w", stdout);//freopen
Cin> N> m;//enter
Int a=1;
Congrauat [a]=true;//news coming from no. 1, no. 1 news
For (mint I=1; i<=m; I++) {
Cin> Nccop [I] x> Nccop [I] y;//enter
If (nccop [I] xSwap (nccop [I]. X, nccop [I] y);
//will be a, b sorting for a}
}
For (mint j=1; j<=n; J++)
For (mint I=1; i<=m; I++) {//scanning friends
If (congrauat [nccop [I]. X]) congrauat [nccop [I] y]=true;
Else if (congrauat [nccop [I]] y) congrauat [nccop [I] x]=true;
//because it is for a friend, a and b, a and b in either side to see the news, the other party will also get news
}
Ans=0;//ans reset
For (mint I=1; i<=n; I++) {//scanning congrauat
If (congrauat [I]) ans++;//if it is true, you get the news
}
cout//fclose (stdin);//fclose
//fclose (stdout);//fclose
return 0;
}

CodePudding user response:

 
# include
using namespace std;
Long long fact (const int& Ab)
{
Int a=1;
for(int i=1; i!=ab + 1; + + I)
{
A *=I;
}
Return a;
}
Int main ()
{
Int x, n.
Double t=0.0;
cout<" Please enter n (number) : "& lt; Cin> n;
cout<" Please input x (variable) : "& lt; Cin> x;
T=t + 1.0;
T=t + x;
for(int i=2; i!=n + 1; + + I)
{
Double p=(x * x)/fact (I);
T +=p;
}
cout<" Results: "& lt; }

CodePudding user response:

 
# include & lt; Cstdio>

Typedef long long LL;

The inline LL jc LL (k) {//factorial
Return k==1? Jc: 1 k * (k - 1);
}

The inline double pw (double x, LL k) {//power
Double ret=1.0;
For (LL I=1; i<=k; Ret i++)=ret * x;
Return ret. nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related