#include<stdio.h>
int mian( )
{
int a,b,c,i,n,sum;
float sn;
for(sum=0,n=1;n<=20;n++)
{
int a=1,b=1;
b=a+b;
a=b;
c=a%b;
sum=c+sum;
sn=sum+n;
}
printf("sn=%f\n",sn);
return 0;
}
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
Cpp1.exe - 1 error(s), 0 warning(s)
问题是:求2/1+3/2+5/3+8/5+13/8+21/13....