Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int first= int.Parse(Console.ReadLine());
- int second= int.Parse(Console.ReadLine());
- int point= int.Parse(Console.ReadLine());
- int left = Math.Min(first, second);
- int right = Math.Max(first, second);
- if (point >= left && point <= right)
- {
- Console.WriteLine("in");
- }
- else
- {
- Console.WriteLine("out");
- }
- int d = Math.Min(Math.Abs(left - point), Math.Abs( right - point));
- Console.WriteLine(d);
- }
- }
Add Comment
Please, Sign In to add comment