eolymp
bolt
Try our new interface for solving problems
Problems

Big product

published at 8/27/21, 4:29:49 pm

a=b a(a+1)...*b ? a*b=a^2 ? a

published at 11/29/21, 3:24:54 pm

NEKO

published at 11/29/21, 3:25:45 pm

GAY

published at 1/4/24, 11:18:04 am

c# - 100%

using System; namespace ConsoleApp1 { internal class Program { static void Main() { string s = Console.ReadLine().Trim(); string[] arr = s.Split(' '); int a = int.Parse(arr[0]); int b = int.Parse(arr[1]);

        if (a <= 0 && b >= 0)
            Console.WriteLine(0);
        else if (a > 0 && b > 0)
            Console.WriteLine(1);
        else
        {
            if ((a - b) % 2 == 0)
                Console.WriteLine(-1);
            else
                Console.WriteLine(1);
        }

        Console.ReadKey();
    }
}

}