Advertisement
I_AM_DEADMAN

[UVa 11727] Cost Cutting

Oct 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. /// https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2827
  2.  
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int t,a,b,c,tmp,p=1,i,j;
  9.     scanf("%d",&t);
  10.     while(t--)
  11.     {
  12.         scanf("%d%d%d",&a,&b,&c);
  13.         if(a>b)
  14.         {
  15.             tmp=a;a=b;b=tmp;
  16.         }
  17.         if(b>c)
  18.         {
  19.             tmp=b;b=c;c=tmp;
  20.         }
  21.         if(a>b)
  22.         {
  23.             tmp=a;a=b;b=tmp;
  24.         }
  25.         printf("Case %d: %d\n",p++,b);
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement