-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmin_max_swap.cpp
55 lines (45 loc) · 1.03 KB
/
min_max_swap.cpp
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
#include <iostream>
#include <utility>
// #include <algorithm>
using namespace std;
// void my_swap(int *a, int *b)
// {
// int tmp = *a;
// *a = *b;
// *b = tmp;
// }
int main()
{
// int a, b, c, d;
// cin >> a >> b >> c >> d;
// // if (a < b)
// // cout << a;
// // else
// // cout << b;
// // cout << min(a, b) << endl;
// // int d;
// // cin >> d;
// // cout << max(a, d) << endl;
// int mn = min({a, b, c, d});
// int mx = max({a, b, c, d});
// cout << "Minimum Number is: " << mn << endl
// << "Maximum number is: " << mx << endl;
// // Swapping Manually
// int a, b;
// cin >> a >> b;
// int tmp = b;
// b = a;
// a = tmp;
// cout << a << " " << b << endl;
// // Swapping using Function
// int a, b;
// cin >> a >> b;
// my_swap(&a, &b);
// cout << a << " " << b;
// Swapping through utility built in function
int a, b;
cin >> a >> b;
swap(a, b);
cout << a << " " << b;
return 0;
}