谢谢
计算 s=1-1/3 + 1/5- 1/7+..1/101 的值并输出
#include<stdio.h>
int main()
{
float i=1;
float s=1;
float n=-1;
whlie (i<=101)
{
s+=n/(i+2);
n=n*(-1);
i=i+2;
}
printf("%f",s);
return 0;
}
代码执行失败
/tmp/ccXDAmEG.o: In function main': main.c:(.text.startup+0xc): undefined reference to
whlie' collect2: error: ld returned 1 exit status
报错也看不懂,哭了