-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUri1042.java
More file actions
52 lines (40 loc) · 1.02 KB
/
Uri1042.java
File metadata and controls
52 lines (40 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import java.util.Scanner;
class Uri1042{
public static void main(String[] args){
int n1,n2, n3, first = 0, second = 0, third = 0, aux;
Scanner input = new Scanner(System.in);
n1 = input.nextInt();
n2 = input.nextInt();
n3 = input.nextInt();
if(n1 <= n2){
first = n1;
second = n2;
}else{
first = n2;
second = n1;
}
if(n3 <= second){
third = second;
second = n3;
}else{
third = n3;
}
if(second <= first){
aux = first;
first = second;
second = aux;
}
if(n1 == n2 && n2 == n3){
first = n1;
second = n2;
third = n3;
}
System.out.println(first);
System.out.println(second);
System.out.println(third);
System.out.println();
System.out.println(n1);
System.out.println(n2);
System.out.println(n3);
}
}