求导大神指导C语言题目,我是新手,
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/07/30 19:45:55
求导大神指导C语言题目,我是新手,
![](http://img.wesiedu.com/upload/7/87/787f7491bdcb1b602281a76bad07f8ca.jpg)
![](http://img.wesiedu.com/upload/1/1a/11aa0cf0475abca47ab0646d824ad46c.jpg)
![](http://img.wesiedu.com/upload/7/87/787f7491bdcb1b602281a76bad07f8ca.jpg)
![](http://img.wesiedu.com/upload/1/1a/11aa0cf0475abca47ab0646d824ad46c.jpg)
![求导大神指导C语言题目,我是新手,](/uploads/image/z/5876251-43-1.jpg?t=%E6%B1%82%E5%AF%BC%E5%A4%A7%E7%A5%9E%E6%8C%87%E5%AF%BCC%E8%AF%AD%E8%A8%80%E9%A2%98%E7%9B%AE%2C%E6%88%91%E6%98%AF%E6%96%B0%E6%89%8B%2C)
5.4:(a)输出:2 0 (b)输出:1 16.9:(a)输出:-1 (b)输出:0 (c)输出:5555555. (d)输出:10 85.10://没测试过,可能有笔误
#include <stdio.h>
#include <math.h> //可以用math.h的库吗
//顺便说一下,那个求根公式貌似写错了,-b应该放在分子上的吧.
int main()
{
double a, b, c;
printf("issue the values of a, b, c(divided by space):"):
scanf("%d%d%d");
if (a == 0)
{
if (b == 0)
printf("the root is: %d", c):
else
printf("the root is: %d", -c / b);
goto END;
}
double delta = b * b - (4 * a * c);
if (delta > 0)//two real roots
printf("the roots is: %d and %d", (-b + sqrt(delta)) / 2 * a, (-b - sqrt(delta)) / 2 * a);
else if (delta == 0)
printf("the root is: %d", (-b + sqrt(delta)) / 2 * a);
else
printf("there are no real roots!");
END:;
}额,还有.6.9的c项是我看错了吗?目测是个死循环.个人临时做的供参考,有错谢谢指正.
#include <stdio.h>
#include <math.h> //可以用math.h的库吗
//顺便说一下,那个求根公式貌似写错了,-b应该放在分子上的吧.
int main()
{
double a, b, c;
printf("issue the values of a, b, c(divided by space):"):
scanf("%d%d%d");
if (a == 0)
{
if (b == 0)
printf("the root is: %d", c):
else
printf("the root is: %d", -c / b);
goto END;
}
double delta = b * b - (4 * a * c);
if (delta > 0)//two real roots
printf("the roots is: %d and %d", (-b + sqrt(delta)) / 2 * a, (-b - sqrt(delta)) / 2 * a);
else if (delta == 0)
printf("the root is: %d", (-b + sqrt(delta)) / 2 * a);
else
printf("there are no real roots!");
END:;
}额,还有.6.9的c项是我看错了吗?目测是个死循环.个人临时做的供参考,有错谢谢指正.