package com.company;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
printMax(a, b ,c);
}
static void printMax(int a, int b, int c) {
int max = Math.max(Math.max(a, b), c);
if (max == a) {
System.out.printf("%d ", a);
if (b >= c) {
System.out.printf("%d %d", b, c);
} else {
System.out.printf("%d %d", c, b);
}
} else if (max == b) {
System.out.printf("%d ", b);
if (a >= c) {
System.out.printf("%d %d", a, c);
} else {
System.out.printf("%d %d", c, a);
}
} else {
System.out.printf("%d ", c);
if (a >= b) {
System.out.printf("%d %d", a, b);
} else {
System.out.printf("%d %d", b, c);
}
}
System.out.println();
}
}Дмитрий
7 уровень
В консоли числа выводятся по убыванию, а условие все-равно не проходит
Обсуждается
Комментарии (2)
- популярные
- новые
- старые
Для того, чтобы оставить комментарий Вы должны авторизоваться
Александр
19 июня 2022, 05:56
Что за класс Main?
0
Дмитрий
21 июня 2022, 17:30
Если вы про название, то просто переименовал
0