Home > Back-end >  Error correction
Error correction

Time:09-22

Trouble to see something wrong
# include
Int main ()
Long f1 (int a)
{
int b;
Long c;
Long f2 (int)
B=a * a;
C=f2 (b);
Return the c;
}
Long f2 (int d)
{
Long e=1;
int i;
for(i=1; i<=d; I++)
E=e * (I);
Return e;

}
The main ()
{
int i;
Long s=0;
for(i=2; i<=3; I++)
S=s + f1 (I);
Printf (" \ ns=% ld \ n ", s);
}

CodePudding user response:

You this is 22 factorial 32 factorial, not 2 factorial plus 3 factorial square of the square of the
B=a * a;
B=a * 10 + 2;

CodePudding user response:

And written directly below the main line, don't have to write under defined above, and you haven't return values below

CodePudding user response:

The
B=a * a;
Change
A + b=10 * a;

CodePudding user response:

 # include 

Long f2 (int d)
{
Long e=1;
int i;
For (I=1; i <=d; I++)
E=e * (I);
Return e;

}

Long f1 (int a)
{
int b;
Long c;
A + b=10 * 2;
C=f2 (b);
Return the c;
}
Int main ()
{
int i;
Long s=0;
For (I=2; i <=3; I++)
S=s + f1 (I);
Printf (" \ ns=% ld \ n ", s);
return 0;
}

C + + environment debugging VS2015
  • Related