Topics such as above, below is my code, but OJ hint I "Segmentation fault: segment error, check whether there is an array, pointer exception, access to should not have access to the area of memory", consult everybody who is my problem?
#include
using namespace std;
Int comb (int x, int y);
Int fun (int x);
Int main () {
Int t, I;
cout<" Both please enter data group 's number="& lt;
If (t> 0 {
Int * m=new int [t];
Int * n=new int [t];
for(i=0; I
}
for(i=0; I
The delete [] n.
}
return(1);
}
Int comb (int x, int y) {
Int z;
Z=fun (x)/(fun fun (y) * (x, y));
Return (z);
}
Int fun (int x) {
If (x!=1) {
Return (fun (x - 1) * (x));
} else {
return(1);
}
}
CodePudding user response:
What is the format of this kind of game, requirements, will be in strict accordance with the format to you, can't do any extra outputYou can't cout which input prompt, only honestly
Cin & gt;> t;
For (... ) {
Cin & gt;> [I] m. & gt;> N [I];
}
Cout is only output the final result
In addition, the n! May be beyond the scope of integer, it is necessary to type double calculation;
CodePudding user response:
Fun