// PascalABC.NET 3.1, сборка 1200 от 13.03.2016 begin var a:=MatrixRandom(7,7,0,9); var k:=0; for var i:=0 to 6 do begin for var j:=0 to 6 do begin Write(a[i,j]:3); if a[i,j] in [1..5] then Inc(k) end; Writeln end; Writeln('Кол-во элементов на [1,5]: ',k) end.
const n=7; var a:array[1..n,1..n] of integer; i,j,k:integer; begin Randomize; k:=0; for i:=1 to n do begin for j:=1 to n do begin a[i,j]:=Random(10); Write(a[i,j]:3); if a[i,j] in [1..5] then Inc(k) end; Writeln end; Writeln('Кол-во элементов на [1,5]: ',k) end.
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите координату x точки");
double x = int.Parse(Console.ReadLine());
Console.WriteLine("Введите координату y точки");
double y = int.Parse(Console.ReadLine());
Console.WriteLine("Введите радиус");
double r = int.Parse(Console.ReadLine());
double d = Math.Sqrt(Math.Pow(-x, 2) + Math.Pow(-y, 2));
Console.WriteLine(d);
if (d < r){
Console.WriteLine("Да");}
else if (d == r){
Console.WriteLine("На границе");}
else{
Console.WriteLine("Нет");}
Console.ReadKey();
}
}