-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCramer.java
More file actions
31 lines (22 loc) · 915 Bytes
/
Cramer.java
File metadata and controls
31 lines (22 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class Cramer {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("input a : ");
double a = input.nextDouble();
System.out.print("input b : ");
double b = input.nextDouble();
System.out.print("input c : ");
double c = input.nextDouble();
System.out.print("input d : ");
double d = input.nextDouble();
System.out.print("input e : ");
double e = input.nextDouble();
System.out.print("input f : ");
double f = input.nextDouble();
double x = ((e*d)-(b*f))/((a*d)-(b*c));
double y = ((a*f)-(e*c))/((a*d)-(b*c));
System.out.println("x = "+" "+x);
System.out.println("y = "+" "+y);
}
}