За до графічного редактора Paint створити 4 великодні писанки, використавши характерні орнаменти різних регіонів України (зразки писанок відшукати в мережі інтернет); 2) роботу зберегти одним зображенням
Using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace pzn {
class Program { public static void Main(string[] args) { int x = Convert.ToInt32(Console.ReadLine()); int y = Convert.ToInt32(Console.ReadLine()); int temp; if (x<y) { x ^= y; y ^= x; x ^= y; } Console.WriteLine("x={0}, y={1}", x, y); Console.ReadKey(); } } }
Function F(x: real): real; begin F := 3 * sin(x) + 2 * sqr(x) - 1; end;
var a, b, h, x, Fa, Fx: real;
begin Write('Введите через пробел начало интервала, конец и шаг: '); Readln(a, b, h); x := a; Fa := F(a); repeat Fx := F(x); if Fx = 0 then Writeln('Найден корень ', x:0:3) else if Fx * Fa < 0 then Writeln('Найден интервал изоляции корня (', a:0:3, ';', x:0:3, ')'); a := x; Fa := Fx; x := x + h until x > b; end.
Тестовое решение:
Введите через пробел начало интервала, конец и шаг: 0 1.95 0.15 Найден интервал изоляции корня (0.150;0.300)
Введите через пробел начало интервала, конец и шаг: -5 5 0.1 Найден интервал изоляции корня (-1.500;-1.400) Найден интервал изоляции корня (0.200;0.300)
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pzn
{
class Program
{
public static void Main(string[] args)
{
int x = Convert.ToInt32(Console.ReadLine());
int y = Convert.ToInt32(Console.ReadLine());
int temp;
if (x<y)
{
x ^= y;
y ^= x;
x ^= y;
}
Console.WriteLine("x={0}, y={1}", x, y);
Console.ReadKey();
}
}
}