新人小白求解决link2001问题,不知道该怎么办了
#include <stdio.h>int fatorial(int a)
{
int j,m,z=1;
j=square(a);
for(m=j;m>0;m--)
z*=m;
return z;
}
int square(int b)
{
int q;
q=b*b;
return q;
}
int main()
{
int i,k,s=0,n;
printf("计算s=(2^2)!+(3^2)!+…+(n^2)!请输入n:\n");
scanf("%d",&n);
do
{
printf("error,请重新输入n:\n");
scanf("%d",&n);
}while(n<2);
for(i=2;i<=n;i++)
{
k=factorial(i);
s+=k;
}
printf("s=(2^2)!+(3^2)!+…+(%d^2)!=%d",n,s);
}
--------------------Configuration: text - Win32 Debug--------------------
Linking...
text.obj : error LNK2001: unresolved external symbol _factorial
Debug/text.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
text.exe - 1 error(s), 0 warning(s)