Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program prog;
- var
- a, b, c, i, j, count, n:longint;
- f : boolean;
- begin
- readln(a);
- // на ходим все делители числа а
- for i := 1 to round(sqrt(a)) do
- if (a mod i = 0) then
- writeln(i,' ', a div i);
- //находим кол-во делителей
- count := 0;
- for i := 1 to round(sqrt(a)) - 1 do
- if (a mod i = 0) then
- count := count + 2;
- if (round(sqrt(i)) * round(sqrt(i)) = i) then
- count := count + 1;
- writeln(count);
- //числа с N делителями на отрезке
- read(a, b, n);
- for i := a to b do begin
- count := 0;
- for j := 1 to round(sqrt(i)) - 1 do
- if (i mod j = 0) then
- count := count + 2;
- if (round(sqrt(i)) * round(sqrt(i)) = i) then
- count := count + 1;
- if (count = n) then
- writeln(i);
- end;
- //проверяем простое ли число
- readln(a);
- f := true;
- for i := 2 to round(sqrt(a)) do
- if (a mod i = 0) then begin
- f := false;
- break;
- end;
- if (f) then
- writeln('YES')
- else
- writeln('NO');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement