#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int x,n;
float sum=0;
printf("Length and Value");
scanf("%d%d",&n,&x);
for(int i=1;i<=n;i++)
{
sum+=(pow(x,2*i+1) * pow(-1,i+1));
}
printf("%f",sum);
return 0;
}
我试图用C语言来解决这个系列。我在上面的代码中做错了什么?要打印该系列答案 - > x^3 - x^5 + x^7 - x^9 +
请避免使用诸如_“somethin'”_,_“doin'”_等字样。这不是聊天室。 –
好的,谢谢你的帮助。 –
不客气,FYR,你可能想参加[旅游](http://stackoverflow.com/tour)并阅读[如何问](http://stackoverflow.com/help/how-to-问) –