Introduction

This is my blog of programming, I take notes and leave codes of computer science problems I solved here. Be my guest to comment :)

Thursday, November 22, 2012

uva 11727 - Cost Cutting


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;

int main() {
 int a,b,c,t;
 cin >> t;
 for (int test = 1; test<=t; test++)
 {
  cin >> a >> b >> c;
  printf("Case %d: %d\n",test,a+b+c-max(c,max(a,b))-min(c,min(a,b)));
 }
 return 0;
}

No comments:

Post a Comment