You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
// For more information see https://aka.ms/fsharp-console-apps
printfn "Hello from F#"
// Функция для вычисления площади круга
let circleArea radius = System.Math.PI * radius * radius
// Функция для вычисления объема цилиндра через суперпозицию
let cylinderVolume radius height =
circleArea radius * height
// Функция для вычисления объема цилиндра через каррирование
let cylinderVolumeCurried radius =
fun height -> circleArea radius * height
// Функция для чтения числа с консоли
let readFloat() =
System.Console.ReadLine()
|> System.Double.Parse
|> float
// Основная функция
[<EntryPoint>]
let main argv =
System.Console.WriteLine("Введите радиус круга:")
let radius = readFloat()
System.Console.WriteLine("Введите высоту цилиндра:")
let height = readFloat()
// Вычисление через суперпозицию
let volume1 = cylinderVolume radius height
System.Console.WriteLine($"Объем цилиндра (через суперпозицию): {volume1:F2}")
// Вычисление через каррирование
let volume2 = (cylinderVolumeCurried radius) height
System.Console.WriteLine($"Объем цилиндра (через каррирование): {volume2:F2}")
// Демонстрация частичного применения
let area = circleArea radius
System.Console.WriteLine($"Площадь круга: {area:F2}")
0