-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1042.c (Beginner_1042_Simple Sort)
More file actions
62 lines (54 loc) · 1.05 KB
/
1042.c (Beginner_1042_Simple Sort)
File metadata and controls
62 lines (54 loc) · 1.05 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
53
54
55
56
57
58
59
60
61
62
#include<stdio.h>
int main ()
{
int a , b , c ;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
int x , y , z ;
if ( a<=b && a<=c )
{
x = a ;
if ( b<=c )
{
y = b ;
z = c ;
}
else
{
y = c ;
z = b ;
}
}
else if ( b<=a && b<=c )
{
x = b ;
if ( a<=c )
{
y = a ;
z = c ;
}
else
{
y = c ;
z = a ;
}
}
else
{
x = c ;
if ( a<=b )
{
y = a ;
z = b ;
}
else
{
y = b ;
z = a ;
}
}
printf("%d \n%d \n%d \n\n",x,y,z);
printf("%d \n%d \n%d \n",a,b,c);
return 0 ;
}