首页 > 其他 > 详细

p95_3.3

时间:2018-10-16 23:16:58      阅读:141      评论:0      收藏:0      [点我收藏+]
 1 import java.util.Scanner;
 2 public class LinearEquation {
 3     public static void main(String[] args){
 4         double a, b, c, d, e, f, x, y;
 5         System.out.println("Enter a,  b, c, d, e, f");
 6         Scanner input = new Scanner(System.in);
 7         a = input.nextDouble();
 8         b = input.nextDouble();
 9         c = input.nextDouble();
10         d = input.nextDouble();
11         e = input.nextDouble();
12         f = input.nextDouble();
13         if((a*d)-(b*c) == 0){
14             System.out.println("The equation has no solution");
15         }
16         else{
17         x=((e*d)-(b*f))/((a*d)-(b*c));
18         y=((a*f)-(e*c))/((a*d)-(b*c));
19         System.out.println("x is " + x + " and y is " + y);
20         }
21     }
22 }

 

p95_3.3

原文:https://www.cnblogs.com/cherrydream/p/9801055.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!