-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow017.cpp
More file actions
66 lines (66 loc) · 1.08 KB
/
flow017.cpp
File metadata and controls
66 lines (66 loc) · 1.08 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
63
64
65
66
#include<iostream>
#include<algorithm>
using namespace std;
int x[3];
int check(int a,int b,int c)
{
int flag;
if(a>b&&a>c&&b>c)
{
x[0]=a;
x[1]=b;
x[2]=c;
flag=x[1];
}
if(a>b&&a>c&&c>b)
{
x[0]=a;
x[1]=c;
x[2]=b;
flag=x[1];
}
if(b>a&&b>c&&a>c)
{
x[0]=b;
x[1]=a;
x[2]=c;
flag=x[1];
}
if(b>a&&b>c&&c>a)
{
x[0]=b;
x[1]=c;
x[2]=a;
flag=x[1];
}
if(c>b&&c>a&&a>b)
{
x[0]=c;
x[1]=a;
x[2]=b;
flag=x[1];
}
if(c>b&&c>a&&b>a)
{
x[0]=c;
x[1]=b;
x[2]=a;
flag=x[1];
}
return flag;
}
int main()
{
int testcase;
int a,b,c;
cin>>testcase;
while(testcase>0)
{
cin>>a;
cin>>b;
cin>>c;
cout<<check(a,b,c)<<endl;
testcase--;
}
return 0;
}