Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.text.DecimalFormat;
- public class ExchangeIfGreater {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- double x = in.nextDouble();
- double y = in.nextDouble();
- DecimalFormat df = new DecimalFormat("0.###");
- if (x > -100 && x < 100 && y > -100 && y < 100) {
- if (x > y) {
- System.out.println(df.format(y) + " " +df.format(x));
- } else {
- System.out.println(df.format(x) + " " +df.format(y));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement