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 Scanner = new Scanner(System.in);
- double a = Scanner.nextDouble();
- double b = Scanner.nextDouble();
- if (a > b) {
- if (a % 1 == 0) {
- System.out.printf("%.0f ", a);
- }
- if (a % 1 != 0) {
- System.out.print(a);
- }
- if (b % 1 == 0) {
- System.out.printf("%.0f", b);
- }
- if (b % 1 != 0) {
- System.out.printf(" " + b);}
- } else {
- if (a % 1 == 0) {
- System.out.printf("%.0f", a);
- }if (a % 1 != 0) {
- System.out.print(a);}
- if (b % 1 == 0) {
- System.out.printf("%.0f ", b);}
- if (b % 1 != 0) {
- System.out.printf(" " + b);}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement