Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- int x1 = int.Parse(Console.ReadLine());
- int x2 = int.Parse(Console.ReadLine());
- int x = int.Parse(Console.ReadLine());
- if (x>= Math.Min(x1,x2)&&x<=Math.Max(x1,x2))
- {
- Console.WriteLine("in");
- if (Math.Abs(x1-x)<Math.Abs(x2-x))
- {
- Console.WriteLine(Math.Abs(x1-x));
- }
- else
- {
- Console.WriteLine(Math.Abs(x2-x));
- }
- }
- else
- {
- Console.WriteLine("out");
- if (Math.Abs(x1 - x) < Math.Abs(x2 - x))
- {
- Console.WriteLine(Math.Abs(x1 - x));
- }
- else
- {
- Console.WriteLine(Math.Abs(x2 - x));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement