Begin var a: integer; readln(a); for i: integer := 1 to abs(a) do if (a mod i = 0) then writeln('> ', i); end.
function Simple(a: integer): boolean; begin result := true; for i: integer := 2 to (a div 2) do if (a mod i = 0) then begin result := false; break; end; end;
begin var a: integer; readln(a); writeln(Simple(a)); end.
var a: integer;
begin readln(a); for i: byte := length(a.ToString()) downto 1 do write(a.ToString()[i]); end.
function Simple(a: integer): boolean; begin result := true; for i: integer := 2 to (a div 2) do if (a mod i = 0) then begin result := false; break; end; end;
function par(a: integer): string; begin for i: byte := length(a.ToString()) downto 1 do result += a.ToString()[i]; end;
begin var a: integer; readln(a); for i: integer := 1 to abs(a) do if ((a mod i = 0) and (Simple(a)) and (par(a) = inttostr(i))) then writeln('> ', i); end.
using System; public class Program{ public static void Main() { int[] a = new int[10]; for (int i = 1; i < 10; i++) a[i] = i; int count = 0; int sum = 0; int mul = 1; for (int i = 0; i < a.Length; i++) if (a[i] > 0) { count++; sum += a[i]; mul *= a[i]; } Console.WriteLine("сумма : " + sum); Console.WriteLine("произвдение : " + mul); Console.WriteLine("количество : " + count); }}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку