编程为什么总是显示error C2296: '&' : illegal, left operand has type 'double *' 这个错误啊..急求解~
#include<stdio.h>#include<math.h>intmain(){doublex,y,m,n,c,a,b,k,l,o,s,t,u,v;scanf("%...
#include <stdio.h>
#include <math.h>
int main()
{
double x,y,m,n,c,a,b,k,l,o,s,t,u,v;
scanf("%lf %lf",&x &c);
y=1,n=1,k=0;
m=x/y;
while(fabs(m)>c)
{k=k+m;
y=y+2;
t=1;
s=1;
if (s<=y)
{s=s+1;
t=s*t;}
n=n+2;
x=-pow(x,n);
m=x/t;}
printf("sinx=%lf\n",m);
a=0,b=0,l=0;
o=pow(x,a)/(a+1);
while(fabs(o)>c);
{l=l+o;
a=a+2;
u=1;
v=1;
if (v<=a)
{ v=v+1;
u=u*v;}
b=b+2;
x=pow(x,b);
x=-x;
o=x/u;}
printf("cosx=%lf\n",l);
return 0;
} 展开
#include <math.h>
int main()
{
double x,y,m,n,c,a,b,k,l,o,s,t,u,v;
scanf("%lf %lf",&x &c);
y=1,n=1,k=0;
m=x/y;
while(fabs(m)>c)
{k=k+m;
y=y+2;
t=1;
s=1;
if (s<=y)
{s=s+1;
t=s*t;}
n=n+2;
x=-pow(x,n);
m=x/t;}
printf("sinx=%lf\n",m);
a=0,b=0,l=0;
o=pow(x,a)/(a+1);
while(fabs(o)>c);
{l=l+o;
a=a+2;
u=1;
v=1;
if (v<=a)
{ v=v+1;
u=u*v;}
b=b+2;
x=pow(x,b);
x=-x;
o=x/u;}
printf("cosx=%lf\n",l);
return 0;
} 展开
3个回答
展开全部
#include <stdio.h>
#include <math.h>
int main()
{
double x,y,m,n,c,a,b,k,l,o,s,t,u,v;
scanf("%lf %lf",&x, &c); // &x 和 &c 之间少了个逗号
y=1,n=1,k=0;
m=x/y;
while(fabs(m)>c)
{k=k+m;
y=y+2;
t=1;
s=1;
if (s<=y)
{s=s+1;
t=s*t;}
n=n+2;
x=-pow(x,n);
m=x/t;}
printf("sinx=%lf\n",m);
a=0,b=0,l=0;
o=pow(x,a)/(a+1);
while(fabs(o)>c);
{l=l+o;
a=a+2;
u=1;
v=1;
if (v<=a)
{ v=v+1;
u=u*v;}
b=b+2;
x=pow(x,b);
x=-x;
o=x/u;}
printf("cosx=%lf\n",l);
return 0;
}
有问题请追问 满意记得采纳
#include <math.h>
int main()
{
double x,y,m,n,c,a,b,k,l,o,s,t,u,v;
scanf("%lf %lf",&x, &c); // &x 和 &c 之间少了个逗号
y=1,n=1,k=0;
m=x/y;
while(fabs(m)>c)
{k=k+m;
y=y+2;
t=1;
s=1;
if (s<=y)
{s=s+1;
t=s*t;}
n=n+2;
x=-pow(x,n);
m=x/t;}
printf("sinx=%lf\n",m);
a=0,b=0,l=0;
o=pow(x,a)/(a+1);
while(fabs(o)>c);
{l=l+o;
a=a+2;
u=1;
v=1;
if (v<=a)
{ v=v+1;
u=u*v;}
b=b+2;
x=pow(x,b);
x=-x;
o=x/u;}
printf("cosx=%lf\n",l);
return 0;
}
有问题请追问 满意记得采纳
追问
没啦.,谢谢那..
展开全部
帮你整理了一下,修改了几个小错误
#include <stdio.h>
#include <math.h>
int main()
{
double x, y, m, n, c, a, b, k, l, o, s, t, u, v;
scanf("%lf%lf", &x, &c);
y = 1, n = 1, k = 0;
m = x / y;
while (fabs(m) > c) {
k = k + m;
y = y + 2;
t = 1;
s = 1;
if (s <= y) {
s = s + 1;
t = s * t;
}
n = n + 2;
x = -pow(x, n);
m = x / t;
}
printf("sinx=%lf\n", m);
a = 0, b = 0, l = 0;
o = pow(x, a) / (a + 1);
while (fabs(o) > c) {
l = l + o;
a = a + 2;
u = 1;
v = 1;
if (v <= a) {
v = v + 1;
u = u * v;
}
b = b + 2;
x = pow(x, b);
x = -x;
o = x / u;
}
printf("cosx=%lf\n", l);
return 0;
}
#include <stdio.h>
#include <math.h>
int main()
{
double x, y, m, n, c, a, b, k, l, o, s, t, u, v;
scanf("%lf%lf", &x, &c);
y = 1, n = 1, k = 0;
m = x / y;
while (fabs(m) > c) {
k = k + m;
y = y + 2;
t = 1;
s = 1;
if (s <= y) {
s = s + 1;
t = s * t;
}
n = n + 2;
x = -pow(x, n);
m = x / t;
}
printf("sinx=%lf\n", m);
a = 0, b = 0, l = 0;
o = pow(x, a) / (a + 1);
while (fabs(o) > c) {
l = l + o;
a = a + 2;
u = 1;
v = 1;
if (v <= a) {
v = v + 1;
u = u * v;
}
b = b + 2;
x = pow(x, b);
x = -x;
o = x / u;
}
printf("cosx=%lf\n", l);
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-11-03
展开全部
好多钱,解决了的话
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询