My issue
string input = Console.ReadLine().Split(’ ', StringSplitOptions.RemoveEmptyEntries);can i take input like this
My code
using System;
public class Test
{
public static void Main()
{
int T = int.Parse(Console.ReadLine());
for (int i = 0; i < T; i++)
{
string[] input = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries);
if (input.Length == 3)
{
int X = int.Parse(input[0]);
int Y = int.Parse(input[1]);
int Z = int.Parse(input[2]);
int t = 5 * X + 10 * Y;
if (Z != 0)
{
int N = t / Z;
Console.WriteLine(N);
} // your code goes here
}
} }
}
Learning course: Basic Math using C++
Problem Link: Chef and Chocolates Practice Problem in - CodeChef