照題目要求去找中間值即是答案
C++(0.036)
/*******************************************************/
/* UVa 11727 Cost Cutting */
/* Author: Maplewing [at] knightzone.studio */
/* Version: 2014/12/25 */
/*******************************************************/
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int T;
while( scanf("%d", &T) != EOF ){
for( int i = 1 ; i <= T ; ++i ){
int salary[3];
scanf("%d%d%d", &salary[0], &salary[1], &salary[2]);
printf("Case %d: %d\n", i, max( min(salary[0], salary[1]), min( max(salary[0], salary[1]), salary[2] ) ));
}
}
return 0;
}