请教高手,哪里出错了?望可以详细解释
#include <iostream.h>template <typename T>
T fac(int n)
{ int f;
if(n<0)
cout<<"error!"<<endl;
else if(n=0)||(n=1)
f=1;
else if(n>1)
f=n*fac(n-1);
return f;
}
int main()
{ int a,b,c,m,n,q,g;
cout<<"please input three numbers:"<<endl;
cin>>a>>b>>c;
m=fac(a);
n=fac(b);
q=fac(c);
g=m+n+q;
cout<<"he="<<g<<endl;
return 0;
}