Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program rabotaet;
- var
- i, n, coren: integer;
- Flag: Boolean;
- s: String;
- begin
- for n := 1000 to 9999 do
- begin
- str(n, s);
- if (s[1] = s[2]) and (s[3] = s[4]) 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