shiee1009 / IT2105

0 stars 0 forks source link

IT2105_LabActivity4_BALMES #2

Open shiee1009 opened 2 hours ago

shiee1009 commented 2 hours ago

using System;

public class HelloWorld { public static void Main(string[] args) { // Test case process Console.Write("No. of test cases: "); int T = Convert.ToInt32(Console.ReadLine());

    int X; // Uber
    int Y; // Grab        

    // Storage of results
    string[] results = new string[T];

    // INPUT
    for (int i = 0; i < T; i++)
    {
        string[] input = Console.ReadLine().Split(' ');

        X = Convert.ToInt32(input[0]);
        Y = Convert.ToInt32(input[1]);

        // conditions
        if (X < Y)
        {
            results[i] = "FIRST";
        }
        else if (X > Y)
        {
            results[i] = "SECOND";
        }
        else
        {
            results[i] = "ANY";
        }
    }

    // OUTPUT
    Console.WriteLine("\nResult:");
    foreach (string result in results)
    {
        Console.WriteLine(result);
    }
}

}

shiee1009 commented 2 hours ago

Screenshot of program: image