Codechef : Problem name "Burgers" solution in C#
========================Solution code in C#===========================
using System;
public class Test
{
public static void Main()
{
int t=Convert.ToInt32(Console.ReadLine());
for(int i=0;i<t;i++){
string[] array=Console.ReadLine().Split(' ');
int A=Convert.ToInt32(array[0]);
int B=Convert.ToInt32(array[1]);
if(A<B){
Console.WriteLine(A);
}
else if(B<A)
Console.WriteLine(B);
else if(A==B)
Console.WriteLine(A);
}
}
}
================================Explanation================================
The lesser number of bun or lesser number of patty will decide the number of burgers can be made
Comments
Post a Comment