帮我看下下这题咋错的
我做了一题求n!的题目。怎么看都不知道是怎么错的。各位帮我看一下啊!要咋改啊#include"iostream"
long fact(int n);
void main()
{
int num;
cout<<"请输入一个数:";
cin>>num;
cout<<num<<"!="<<fact(num)<<endl;
}
long fact(int n)
{
if(n<=1)
return 1;
else
return (fact(n-1)*n);
}
它给的错误信息是酱紫的
--------------------Configuration: d - Win32 Debug--------------------
Compiling...
s.cpp
E:\学习\d\s.cpp(2) : error C2018: unknown character '0xa3'
E:\学习\d\s.cpp(2) : error C2018: unknown character '0xbb'
E:\学习\d\s.cpp(3) : warning C4518: 'void ' : storage-class or type specifier(s) unexpected here; ignored
E:\学习\d\s.cpp(3) : error C2146: syntax error : missing ';' before identifier 'main'
E:\学习\d\s.cpp(3) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
s.obj - 1 error(s), 0 warning(s)