Advertisement
Deinio

Untitled

May 15th, 2022
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner Scanner = new Scanner(System.in);
  6. double a = Scanner.nextDouble();
  7. double b = Scanner.nextDouble();
  8. if (a > b) {
  9. if (b % 1 == 0) {
  10. System.out.printf("%.0f ", b);
  11. }
  12. if (b % 1 != 0) {
  13. System.out.print(b);
  14. }
  15. if (a % 1 == 0) {
  16. System.out.printf("%.0f", a);
  17. }
  18. if (a % 1 != 0) {
  19. System.out.printf(" " + a);}
  20.  
  21. } else {
  22. if (a % 1 == 0) {
  23. System.out.printf("%.0f ", a);
  24. }if (a % 1 != 0) {
  25. System.out.print(a);}
  26. if (b % 1 == 0) {
  27. System.out.printf("%.0f", b);}
  28. if (b % 1 != 0) {
  29. System.out.printf(" " + b);}
  30.  
  31.  
  32. }
  33.  
  34. }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement