UVa 11727 Cost Cutting (water ver.)

11727 - Cost Cutting

Time limit: 1.000 seconds

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2827

Company XYZ have been badly hit by recession and is taking a lot of cost cutting measures. Some of these measures include giving up office space, going open source, reducing incentives, cutting on luxuries and issuing pink slips.

They have got three (3) employees working in the accounts department and are going to lay-off two (2) of them. After a series of meetings, they have decided to dislodge the person who gets the most salary and the one who gets the least. This is usually the general trend during crisis like this.

You will be given the salaries of these 3 employees working in the accounts department. You have to find out the salary of the person who survives.

Input

The first line of input is an integer T (T<20) that indicates the number of test cases. Each case consists of a line with 3 distinct positive integers. These 3 integers represent the salaries of the three employees. All these integers will be in the range [1000, 10000].

Output

For each case, output the case number followed by the salary of the person who survives.

Sample Input   Output for Sample Input

3

1000 2000 3000

3000 2500 1500

1500 1200 1800

Case 1: 2000
Case 2: 2500
Case 3: 1500

查看本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/

完整代码:

/*0.013s*/

#include<cstdio>
#include<algorithm>
using namespace std;  

int a[3];  

int main()
{
    int t;
    scanf("%d", &t);
    for (int i = 1; i <= t; ++i)
    {
        scanf("%d%d%d", &a[0], &a[1], &a[2]);
        nth_element(a, a + 1, a + 3);
        printf("Case %d: %d\n", i, a[1]);
    }
    return 0;
}

作者:csdn synapse7

以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索accounts
, and
, of
, The
have
water jet cutting、waterjet cutting、water cutting、en11727是什么测试、cutting edge,以便于您获取更多的相关知识。

时间: 2025-01-01 07:48:11

UVa 11727 Cost Cutting (water ver.)的相关文章

UVa 10079 Pizza Cutting (water ver.)

10079 - Pizza Cutting Time limit: 8.333 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1020 When someone calls Ivan lazy, he claims that it is his intelligence that helps

UVa 10300 Ecological Premium (water ver.)

10300 - Ecological PremiumTime limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=1241 German farmers are given a premium depending on the conditions at their far

UVa 488 Triangle Wave (water ver.)

488 - Triangle Wave Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=429 In this problem you are to generate a triangular wave form according to a specifie

UVa 10783 Odd Sum (water ver.)

10783 - Odd Sum Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1724 Given a range [a, b], you are to find the summation of all the odd integers in this r

UVa 11332 Summing Digits (water ver.)

11332 - Summing Digits Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2307 For a positive integer n, let f(n) denote the sum of the digits of n when repr

UVa 12250 Language Detection (water ver.)

12250 - Language Detection Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=3402 English, Spanish, German, French, Italian and Russian are the 6 most promi

UVa 10252 Common Permutation (water ver.)

10252 - Common Permutation Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1193 Given two strings of lowercase letters, a and b, print the longest string

UVa 371 Ackermann Functions (water ver.)

371 - Ackermann Functions Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=307 An Ackermann function has the characteristic that the length of the sequence

UVa 11547 Automatic Answer (water ver.)

11547 - Automatic Answer Time limit: 1.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2542 Last month Alice nonchalantly entered her name in a draw for a Tapmaster 400