eolymp
bolt
Try our new interface for solving problems
Məsələlər

Böyük hasil

dərc olunub 27.08.21 16:29:49

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

dərc olunub 29.11.21 15:24:54

NEKO

dərc olunub 29.11.21 15:25:45

GAY

dərc olunub 04.01.24 11:18:04

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();
    }
}

}