Технический форум

Технический форум (http://www.tehnari.ru/index.php)
-   Помощь студентам (http://www.tehnari.ru/forumdisplay.php?f=41)
-   -   Перенести код на Windows Form (http://www.tehnari.ru/showthread.php?t=269946)

KamaR12 29.11.2020 19:09

Перенести код на 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.