新手求助: erro: ld returned 1 exit status (code::blocks软件)
/*求谐函数1+1/2+1/3+...+1/n的和*/#include<stdio.h>
main()
{
int i,j,N;
float Sum;
printf("请输入N的值:");
scanf("%d\n",&N);
i=0;j=0;
Sum=0;
while(i<=N-1)
{
j=1+i;
Sum=Sum+1/j;
i=i+1;
}
printf("谐函数的和为:%4.2f",Sum);
return 0;
}
=========================
Build 运行显示:
undefined reference to 'printf'
erro: ld returned l exit status
望达人不吝赐教:)
[此贴子已经被作者于2018-1-28 16:39编辑过]