满意答案
cigya
2013.04.08
采纳率:42% 等级:12
已帮助:11052人
//file1.cpp
inline int fac(int n){
if(n<0)
return 0; //负数无阶乘
int f = 1;
for(n;n>0;n--){
f = f*n;
}
return f;
}
//file2.cpp
#include
#include
#include "file1.cpp"
using namespace std;
int main(){
int a,n;
float b,p,result;
cout <
cout<
cin >>a;
cout <
cin >>b;
cout <
cin >>n;
p = pow(b,n);
if(!p){
cout << "Divisor cannot be zero"<
}else{
result = fac(a)/p;
cout << "Result is :" <
}
system("pause");
return 0;
}
00分享举报