11727 - Cost Cutting

All about problems in Volume 117. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Gamer_CSE_JU
New poster
Posts: 1
Joined: Thu May 10, 2018 9:29 pm

11727 - Cost Cutting

Post by Gamer_CSE_JU »

I am trying to get the middle value but somehow my conditions are not working or else I am doing them wrong. I am a newbie. Can anyone help please? Here's the code:

Code: Select all

#include<stdio.h>
int main() {
int i,count, a, b, c;

scanf("%d", &count);
for(i=1;i<=count;i++){
    scanf("%d %d %d", &a, &b, &c);
    if((a<b&&b<c) || (c<<b&&b<<a)) {
        printf("Case %d: %d\n",i, b);
    } else if((b<<a&&a<<c)||(c<<a&&a<<b)) {
        printf("Case %d: %d\n",i, a);
    } else {
        printf("Case %d: %d\n",i, c);
    }
}

return 0;
}
Post Reply

Return to “Volume 117 (11700-11799)”