Algorithm of 11727 - Cost Cutting

Problem Description Link
ALgorithm:
This problem determine the medium salary that not lowest or highest.
let a, b and c are salaries and avg is medium salary that
we determine.
1. get input testcase
2. get input a, b, c
3.
           if((b>a and b<c)||(b<a and b>c))
                avg=b;
            else if((c>a and c<b)||(c<a and c>b))
                avg=c;
            else
                avg=a;
4.print the avg.
image

No comments:

Post a Comment

Write your comment - Share Knowledge and Experience