Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program rabotaet;
- var
- i, n, coren, n1, n2, n3, n4: integer;
- Flag: Boolean;
- begin
- for n := 1000 to 9999 do
- begin
- n1 := n div 1000;
- n2 := n div 100 mod 10;
- n3 := n div 10 mod 10;
- n4 := n mod 10;
- if (n1 = n2) and (n3 = n4) then
- begin
- Flag := False;
- coren := trunc(sqrt(n));
- for i := 2 to coren do
- if n mod i = 0 then
- begin
- Flag := True;
- break;
- end;
- if not(Flag) then
- Writeln('Простое ', n)
- else
- Writeln('Не простое ', n);
- end;
- end;
- Readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement