Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- float a = scan.nextFloat(), b = scan.nextFloat();
- if (a <= 0 && b <= 0)
- System.out.print("no such x");
- else
- {
- float c = b/a;
- if (a >= 0 && b > 0)
- System.out.print("any x");
- else if (a > 0 && b < 0)
- System.out.print("x<" + String.format("%.1f",c) + " or " + "x>" + String.format("%.1f",-c));
- else if (a < 0 && b > 0)
- System.out.print(String.format("%.1f",c) + "<x<" + String.format("%.1f",-c));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement