Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.83 KB | None | 0 0
  1. //package javaaplication1;
  2.  
  3. import java.util.Scanner;
  4. import java.util.Formatter;
  5. import java.util.*;
  6.  
  7. public class Main {
  8.    
  9.    public static void main(String[] args) throws Exception{
  10.        Scanner in = new Scanner(System.in);
  11.         double a = in.nextDouble(), b = in.nextDouble(), c = in.nextDouble(), d = in.nextDouble(), e = in.nextDouble(), f = in.nextDouble();
  12.         Formatter fmt = new Formatter();
  13.       // System.out.printf("%.3f\n",(c*e - f*b)/(a*e - b*d));
  14.        
  15.         fmt.format("%.3f",(c*e - f*b)/(a*e - b*d));
  16.         System.out.println(fmt.toString().replace(",", "."));
  17.       //  fmt.toString().replace(",", ".")
  18.         fmt = new Formatter();
  19.         fmt.format("%.3f",(a*f - d*c)/(a*e - b*d));
  20.        System.out.println(fmt.toString().replace(",", "."));
  21.        // System.out.printf("%.3f\n",(a*f - d*c)/(a*e - b*d));
  22.    }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement