Cost Cutting

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2827 三个数中,选出中间那个,cmax我用来表示的

#include<stdio.h>

int main(){

    int n,a,b,c,cmax,m=0;

    scanf("%d",&n);

    while(n--){

    m++;

    scanf("%d%d%d",&a,&b,&c);

    if(a>b)if(a>c)if(b>c)cmax=b;

                   else  cmax=c;

           else cmax=a;

    else if(b>c)if(a>c)cmax=a;

              else cmax=c;

          else  cmax=b;

    printf("Case %d: %d\n",m,cmax);

}

       return 0;    

}

posted @ 2013-02-28 18:50  L kill  阅读(174)  评论(0编辑  收藏  举报