Skip to content

Commit 65f27e5

Browse files
solution of small to large number
1 parent 6fc38f5 commit 65f27e5

File tree

3 files changed

+35
-61
lines changed

3 files changed

+35
-61
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/inactive_issue.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

small_to_large/en.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Dimik - Small to Large
2+
3+
There will be three different numbers. They have to be printed from small to large sizes.
4+
5+
### Solution
6+
* Case number will be according to the number of test case.
7+
* Finding the middle number which is not min or max is the main task.
8+
9+
### C++
10+
```cpp
11+
#include <iostream>
12+
#include <algorithm>
13+
using namespace std;
14+
15+
int main(){
16+
int test_case;
17+
cin >> test_case;
18+
19+
for (int i = 1; i <= test_case; i++){
20+
int n1, n2, n3;
21+
cin >> n1 >> n2 >> n3;
22+
int a = min(min(n1, n2), n3);
23+
int b = max(max(n1, n2), n3);
24+
if (n1 != a && n1 != b)
25+
{
26+
cout << "Case " << i <<": " << a << " " << n1 << " " << b << endl;
27+
} else if (n2 != a && n2 != b){
28+
cout << "Case " << i <<": " << a << " " << n2 << " " << b << endl;
29+
} else if (n3 != a && n3 != b){
30+
cout << "Case " << i <<": " << a << " " << n3 << " " << b << endl;
31+
}
32+
}
33+
return 0;
34+
}
35+
```

0 commit comments

Comments
 (0)