PascalABC.NET
#1
begin
var A := Range(1, ReadInteger('n=')).Where(x -> x mod 10 <> 0);
A.Where(x-> x mod (x mod 10) = 0).Println;
end.
#2
function NumSum(number:integer):integer;
NumSum := 0;
while number > 0 do begin
NumSum += number mod 10;
number := number div 10;
end;
var A := Range(100, 999);
A.Where(x -> (x mod 7 = 0) and (NumSum(x) = 7)).Println;
#3
function IsSimple(number:integer):boolean;
IsSimple := number >= 2;
for var i := 2 to trunc(sqrt(number)) do if number mod i = 0 then IsSimple := false
var N := ReadInteger();
Print(IsSimple(N));
PascalABC.NET
#1
begin
var A := Range(1, ReadInteger('n=')).Where(x -> x mod 10 <> 0);
A.Where(x-> x mod (x mod 10) = 0).Println;
end.
#2
function NumSum(number:integer):integer;
begin
NumSum := 0;
while number > 0 do begin
NumSum += number mod 10;
number := number div 10;
end;
end;
begin
var A := Range(100, 999);
A.Where(x -> (x mod 7 = 0) and (NumSum(x) = 7)).Println;
end.
#3
function IsSimple(number:integer):boolean;
begin
IsSimple := number >= 2;
for var i := 2 to trunc(sqrt(number)) do if number mod i = 0 then IsSimple := false
end;
begin
var N := ReadInteger();
Print(IsSimple(N));
end.