关于C语言函数

[复制链接]
查看11 | 回复3 | 2009-6-12 17:30:35 | 显示全部楼层 |阅读模式
这个函数root()可以求虚根#include #include void root(double, double, double);int main(){ double a, b, c; printf("Please enter the coefficients a, b, c:"); scanf("%lf%lf%lf", &a, &b, &c); root(a, b, c); return 0;}void root(double a, double b, double c){ if(a == 0) printf("Wrong param...
回复

使用道具 举报

千问 | 2009-6-12 17:30:35 | 显示全部楼层
#include #include void main (){ float a,b,c,x1,x2,dt,p,q;
printf("输入a,b,c:"); scanf("%f%f%f",&a,&b,&c); dt=sqrt(b*b-4*a*c);
p=-b/(2*a); q=d...
回复

使用道具 举报

千问 | 2009-6-12 17:30:35 | 显示全部楼层
妈……的,天天有人问这种问题。...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行