编译错误,可是我调试的是对的,请求帮忙
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
long int fac(int n){
if((n==0)||(n==1))return 1;
else return n*fac(n-1);
}
int main(){
long int n;
int m=-1;
long int sum=0;
cin>>n;
if(n<=0)cout<<"Incorrect input!";
else {
for(int i=1;i<=n;i++){
m*=-1;
sum+=m*fac(i);
}
if((sum<=INT_MAX)&&(sum>=INT_MIN)) cout<<sum;
else cout<<"Out of range!";
}
return 0;
}