/* קלט: מספר הצעדים בין הבתים של טלי ושל אודי פלט: אורך החבל הנדרש */ using System; public class Rope { public static void Main() { // הגדרת משתנים int stepForward, stepRight; // המספרים הניתנים כקלט double side1, side2; // ערכי הניצבים של המשולש double ropeLength; // אורך החבל const double STEP_SIZE = 0.42; // קבוע – גודל צעד // קלט Console.Write("Enter number of steps forward: "); stepForward = int.Parse(Console.ReadLine()); Console.Write("Enter number of steps to the right: "); stepRight = int.Parse(Console.ReadLine()); // חישוב אורך החבל side1 = stepForward * STEP_SIZE; side2 = stepRight * STEP_SIZE; ropeLength = 2 * Math.Sqrt((side1 * side1) + (side2 * side2)); // פלט Console.WriteLine("The rope length is: {0,2:f}", ropeLength); } // Main } // class Rope