summaryrefslogtreecommitdiff
path: root/11727/cost.cpp
blob: 69dded2ee2de48fdcea749184a26445f435e9a29 (plain)
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
#include <iostream>
using namespace std;

int main(){
  int ct, x=0, ar[3], temp;
  cin>>ct;
  while(x<ct)
    {
      cin>>ar[0]>>ar[1]>>ar[2];
      bool sorted=false;
      while(!sorted)
	for(int i=1;i<3;i++)
	  {      
	    sorted=true;
	    if(ar[i]<ar[i-1])
	      {
		sorted=false;
		temp=ar[i-1];
		ar[i-1]=ar[i];
		ar[i]=temp;
	      }
	  }
      cout<<"Case "<<x+1<<": "<<ar[1]<<endl;;
      x++;
    }
}