-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheasy.c
50 lines (43 loc) · 866 Bytes
/
easy.c
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
#include <stdio.h>
int main(){
int a, b, c, temp;
char order[4];
scanf("%d%d%d", &a, &b, &c);
scanf("%s", &order);
if(a > b){
temp = a;
a = b;
b = temp;
}
if(b > c){
temp = b;
b = c;
c = temp;
}
if(a > b){
temp = a;
a = b;
b = temp;
}
if(order[0] == 'A'){
printf("%d ", a);
}else if(order[0] == 'B'){
printf("%d ", b);
}else if(order[0] == 'C'){
printf("%d ", c);
}
if(order[1] == 'A'){
printf("%d ", a);
}else if(order[1] == 'B'){
printf("%d ", b);
}else if(order[1] == 'C'){
printf("%d ", c);
}
if(order[2] == 'A'){
printf("%d", a);
}else if(order[2] == 'B'){
printf("%d", b);
}else if(order[2] == 'C'){
printf("%d", c);
}
}