11727 - Cost Cutting || UVa Online Judge

Problem name: 11727 - Cost Cutting
Problem link: 11727 - Cost Cutting
Judge: UVa Online Judge
Solution on GitHub: 11727 - Cost Cutting


UVa 11727 - Cost Cutting Solution in C++/Cpp


#include <iostream>
using namespace std;

int main()
{
    int t, count = 0;
    cin >> t;
    for (int i = 0; i < t; i++)
    {
        count++;
        int a, b, c;
        cin >> a >> b >> c;
        if ((a > b && a < c) || (a < b && a > c))
        {
            cout << "Case " << count << ": " << a << endl;
        }
        else if ((b > a && b < c) || (b < a && b > c))
        {
            cout << "Case " << count << ": " << b << endl;
        }
        else
        {
            cout << "Case " << count << ": " << c << endl;
        }
    }

    return 0;
}




Thumbnail:



Next Post Previous Post
No Comment
Add Comment
comment url