谁帮我用c++写一个y=x^5+7(x^2)+1的计算程序,for循环。急求!!谢谢!!!
答案:3 悬赏:10
解决时间 2021-01-13 08:31
- 提问者网友:贪了杯
- 2021-01-12 22:28
谁帮我用c++写一个y=x^5+7(x^2)+1的计算程序,for循环。急求!!谢谢!!!
最佳答案
- 二级知识专家网友:山有枢
- 2021-01-12 22:51
int main(){
double x,s[99];
for(i=0,s[i]=0;cin>>x;i++){
s[i]=x*x*x*x*x+7*x*x+1;
cout<<"s[i]="<}
return 0;
}
double x,s[99];
for(i=0,s[i]=0;cin>>x;i++){
s[i]=x*x*x*x*x+7*x*x+1;
cout<<"s[i]="<
return 0;
}
全部回答
- 1楼网友:duile
- 2021-01-13 00:18
我暂时保留我的看法!
- 2楼网友:杯酒困英雄
- 2021-01-12 23:28
int x = 0,y = 0;
scanf("%d", &x);
int temp = x;
for(int i = 0; i < 5; i++)
{
temp = temp*x;
}
y = temp + x * x * 7 + 1;
printf("y = %d\r\n", y);追问智者,是c++的,你的是c语言追答scanf改成cin>> x;
printf改成cout<<"y="<
scanf("%d", &x);
int temp = x;
for(int i = 0; i < 5; i++)
{
temp = temp*x;
}
y = temp + x * x * 7 + 1;
printf("y = %d\r\n", y);追问智者,是c++的,你的是c语言追答scanf改成cin>> x;
printf改成cout<<"y="<
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息