import java.util.Scanner;
public class LinearEquation {
public static void main(String[] args){
double a, b, c, d, e, f, x, y;
System.out.println("Enter a, b, c, d, e, f");
Scanner input = new Scanner(System.in);
a = input.nextDouble();
b = input.nextDouble();
c = input.nextDouble();
d = input.nextDouble();
e = input.nextDouble();
f = input.nextDouble();
if((a*d)-(b*c) == 0){
System.out.println("The equation has no solution");
}
else{
x=((e*d)-(b*f))/((a*d)-(b*c));
y=((a*f)-(e*c))/((a*d)-(b*c));
System.out.println("x is " + x + " and y is " + y);
}
}
}

Exercise03_03的更多相关文章

随机推荐

  1. java的哈希遍历 hashmap

    Map<String,String> map = new HashMap<String, String>(); map.put("title"," ...

  2. bzoj 4880 [Lydsy1705月赛]排名的战争 贪心

    [Lydsy1705月赛]排名的战争 Time Limit: 8 Sec  Memory Limit: 256 MBSubmit: 338  Solved: 69[Submit][Status][Di ...

  3. ppk和pem证书互转

    首先你得去下载个putty pem:通用证书格式 ppk:为putty下面的专有格式     pem->ppk 直接通过putty下的puttygen.exe 选的Load private ke ...

  4. 封装常用的Javascript跨浏览器方法

    var EventUntil={ // 跨浏览器的添加事件方法 addHandler:function(element,type,handler){ if(element.addEventListen ...

  5. POJ 1064---二分搜索法

    ///2.假定一个解并判断是否可行 ///POJ1064 /** Q:有N条绳子,长度分别为Li,从中切割出k条长度相同的绳子, 这K条绳子最长能有多长?保留两位小数 A: 二分搜索模型. 条件C(x ...

  6. 正式进入搭建OpenStack

    部署mariadb数据库 控制节点: yum install mariadb mariadb-server python2-PyMySQL -y 编辑: /etc/my.cnf.d/openstack ...

  7. bzoj 1192 二进制

    原题传送门http://www.lydsy.com/JudgeOnline/problem.php?id=1192 继续刷水题,二进制思想 //By BLADEVIL var x :longint; ...

  8. HDU1010(dfs+剪枝)

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  9. UVA 10385 Duathlon

    Problem HDuathlonInput: standard inputOutput: standard outputTime Limit: 15 seconds A duathlon is a ...

  10. Make recursive

    folder structure: Makefile t1/Makefile t1/t1.c t2/Makefile t2/t2.c Makefile SUBDIRS = t1 t2 all: for ...