解题思路:
注意事项:
x=(-b±√(b^bai2-4ac))/(2a)
参考代码:
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int d=b*b-4*a*c;
System.out.print(String.format("%.2f", ((-1*b)+Math.sqrt(d))/2*a)+" ");
System.out.println(String.format("%.2f", ((-1*b)-Math.sqrt(d))/2*a));
0.0分
2 人评分
C语言训练-求矩阵的两对角线上的元素之和 (C++代码)浏览:800 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:322 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:539 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:567 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:373 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:505 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:667 |
【计算两点间的距离】 (C语言代码)浏览:1473 |
三角形 (C语言代码)浏览:900 |
数字游戏 (C++代码)浏览:1173 |