Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef took an examination two times. In the first attempt, he scored XX marks while in the second attempt he scored YY marks. According to the rules of the examination, the best score out of the two attempts will be considered as the final score.
Determine the final score of the Chef.
For each test case, output the final score of Chef in the examination.
Input: 4
40 60
67 55
50 50
1 100
Output: 60
67
50
100
Test Case 1: The best score out of the two attempts is 6060.
Test Case 2: The best score out of the two attempts is 6767.
Test Case 3: The best score out of the two attempts is 5050.
for i in range(int(input())):
a,b=map(int,input().split())
if b>a:
print(b)
else:
print(a)
#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
while(n--){
int x,y;
cin>>x>>y;
if (x>y)
cout<<x<<endl;
else
cout<<y<<endl;
}
return 0;
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i=0;i<t ;i++ ){
int x = sc.nextInt();
int y = sc.nextInt();
if(x>=y){
System.out.println(x);
}
else{
System.out.println(y);
}
}
}
}
In our experience, we suggest you solve this Best of Two CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Best of Two CodeChef Solution
I hope this Best of Two CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>