My issue
hey how can i get value for this
I am giving a test on vjudge and its asking for value
Please login into CodeChef with your own account, and fill corresponding 'value’s below.
More tips.
Type Domain Name Value
COOKIE codechef.com SESS978ee31**3
My code
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt(); // Number of test cases
for (int t = 0; t < T; t++) {
int A = scanner.nextInt();
int B = scanner.nextInt();
int C = scanner.nextInt();
int secondLargest = findSecondLargest(A, B, C);
System.out.println(secondLargest);
}
scanner.close();
}
public static int findSecondLargest(int A, int B, int C) {
if ((A >= B && A <= C) || (A <= B && A >= C))
return A;
else if ((B >= A && B <= C) || (B <= A && B >= C))
return B;
else
return C;
}
}
Problem Link: FLOW017 Problem - CodeChef