Перенести код на Windows Form
Вложений: 2
Перенести код на Windows Form. В качестве f(x) - используется x^2. Примерное окно в файле kf,f+2.
using System; using System.Text; namespace fornekit { class Program { static void Main(string[] args) { int x, p; double s; Console.WriteLine("Введите числа x и p (x>|p|):"); x = Convert.ToInt32(Console.ReadLine()); p = Convert.ToInt32(Console.ReadLine()); if (x>Math.Abs(p)) { s = 2 * Math.Pow(x, 6) + 3 * Math.Pow(p, 2); Console.WriteLine($"l1 = : {s} "); } else { Console.WriteLine($"Неправильный ввод!"); } Console.WriteLine("Введите числа x и p (3<x<|p|):"); x = Convert.ToInt32(Console.ReadLine()); p = Convert.ToInt32(Console.ReadLine()); if (x > 3 & x < Math.Abs(p)) { s = Math.Abs(x*x-p); Console.WriteLine($"l2 = : {s} "); } else { Console.WriteLine($"Неправильный ввод!"); } |
Часовой пояс GMT +4, время: 18:14. |
Powered by vBulletin® Version 4.5.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.