using System;
namespace ConsoleApp4
{
class Program
static void PrintDivisors(int a)
Console.Write("делители для числа " + a.ToString() + "(исключая само число и 1): ");
for (int i = 2; i <a; i++)
if (a % i == 0)
Console.Write(i.ToString() + " ");
Console.WriteLine("");
}
static void Main(string[] args)
Console.WriteLine("Введите m и n");
int m, n;
m = int.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
if (n < m)
Console.WriteLine("Неверный ввод");
else
for(int i=m;i<=n;i++)
PrintDivisors(i);
Console.ReadKey();
program ArrayCalc;
var
ar: array[1..4, 1..4] of integer;
function Neg (Row: Integer): Integer;
i: Integer;
begin
Result := 0;
for i := 1 to 4 do
if ar [Row, i] <= 0 then
inc (Result);
end;
i, j, imax, n, nmax: byte;
f: text;
assign(f, 'mas.txt');
rewrite (f);
randomize;
for i := 1 to 4 do begin
for j := 1 to 4 do begin
ar[i, j] := random (200) - 100;
write (IntToStr (ar [i, j]) :4);
write (f, IntToStr (ar [i, j]) :4);
writeln (f, '');
writeln;
close (f);
imax := 1;
nmax := 0;
n := Neg (i);
if n > nmax then begin
nmax := n;
imax := i
WriteLn;
WriteLn ('Строка массива:');
for j := 1 to 4 do
Write (ar [imax, j] :4);
ReadLn;
end.
using System;
namespace ConsoleApp4
{
class Program
{
static void PrintDivisors(int a)
{
Console.Write("делители для числа " + a.ToString() + "(исключая само число и 1): ");
for (int i = 2; i <a; i++)
if (a % i == 0)
Console.Write(i.ToString() + " ");
Console.WriteLine("");
}
static void Main(string[] args)
{
Console.WriteLine("Введите m и n");
int m, n;
m = int.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
if (n < m)
Console.WriteLine("Неверный ввод");
else
for(int i=m;i<=n;i++)
PrintDivisors(i);
Console.ReadKey();
}
}
}
program ArrayCalc;
var
ar: array[1..4, 1..4] of integer;
function Neg (Row: Integer): Integer;
var
i: Integer;
begin
Result := 0;
for i := 1 to 4 do
if ar [Row, i] <= 0 then
inc (Result);
end;
var
i, j, imax, n, nmax: byte;
f: text;
begin
assign(f, 'mas.txt');
rewrite (f);
randomize;
for i := 1 to 4 do begin
for j := 1 to 4 do begin
ar[i, j] := random (200) - 100;
write (IntToStr (ar [i, j]) :4);
write (f, IntToStr (ar [i, j]) :4);
end;
writeln (f, '');
writeln;
end;
close (f);
imax := 1;
nmax := 0;
for i := 1 to 4 do begin
n := Neg (i);
if n > nmax then begin
nmax := n;
imax := i
end;
end;
WriteLn;
WriteLn ('Строка массива:');
for j := 1 to 4 do
Write (ar [imax, j] :4);
ReadLn;
end.