Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HM
- {
- class Program
- {
- static void Main(string[] args)
- {
- double[] arrValues = Array.ConvertAll<string, double>(Console.ReadLine().Split(new char[] { ' ' },
- StringSplitOptions.RemoveEmptyEntries), elem => { return System.Convert.ToDouble(elem); });
- double floor = arrValues[0];
- double down = arrValues[1];
- double up = arrValues[2];
- if (floor < 0 && (floor + (up - down)) >= 0)
- Console.WriteLine(floor + (up - down) + 1);
- else if (floor > 0 && (floor + (up - down)) <= 0)
- Console.WriteLine(floor + (up - down) - 1);
- else
- Console.WriteLine(floor + (up - down));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement