函数long factorial(int n);
#include<stdio.h>longfactorial(intn);longsum(inta,intb){longc1,c2;c1=factorial(a);c2=...
#include<stdio.h>
long factorial(int n);
long sum(int a,int b)
{
long c1,c2;
c1 = factorial(a);
c2 = factorial(b);
return (c1+c2);
}
int main(void)
{
int n1,n2;
long a;
scanf("%d,%d\n",&n1,&n2);
a=sum(n1,n2);
printf("a=%d\n",a);
return 0;
}
程序编译时的错误代码--------------------Configuration: test - Win32 Debug--------------------
Linking...
test.obj : error LNK2001: unresolved external symbol "long __cdecl factorial(int)" (?factorial@@YAJH@Z)
Debug/test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
test.exe - 2 error(s), 0 warning(s)
factorial这个函数是求介乘的函数吗?
那我输入0 5 那得到的答案应该就是120
输入 2 3 得到8
请问那两个错误是什么?我的答案是否正确? 展开
long factorial(int n);
long sum(int a,int b)
{
long c1,c2;
c1 = factorial(a);
c2 = factorial(b);
return (c1+c2);
}
int main(void)
{
int n1,n2;
long a;
scanf("%d,%d\n",&n1,&n2);
a=sum(n1,n2);
printf("a=%d\n",a);
return 0;
}
程序编译时的错误代码--------------------Configuration: test - Win32 Debug--------------------
Linking...
test.obj : error LNK2001: unresolved external symbol "long __cdecl factorial(int)" (?factorial@@YAJH@Z)
Debug/test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
test.exe - 2 error(s), 0 warning(s)
factorial这个函数是求介乘的函数吗?
那我输入0 5 那得到的答案应该就是120
输入 2 3 得到8
请问那两个错误是什么?我的答案是否正确? 展开
1个回答
2013-05-16
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询