SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args)
  6.     {
  7.         Scanner scan = new Scanner(System.in);
  8.         float a = scan.nextFloat(), b = scan.nextFloat();
  9.         if (a <= 0 && b <= 0)
  10.             System.out.print("no such x");
  11.         else
  12.             {
  13.                 float c = b/a;
  14.                 if (a >= 0 && b > 0)
  15.                 System.out.print("any x");
  16.                 else if (a > 0 && b < 0)
  17.                 System.out.print("x<" + String.format("%.1f",c) + " or " + "x>" + String.format("%.1f",-c));
  18.                 else if (a < 0 && b > 0)
  19.                 System.out.print(String.format("%.1f",c) + "<x<" + String.format("%.1f",-c));
  20.             }
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top