Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. (khai báo)
  2. BEGIN
  3. write('Nhập số phần tử của mảng: '); read(n);
  4. for i:=1 to n do read(a[i]);
  5. write('Các số nguyên tố là: ');
  6. for i:=1 to n do
  7. if a[i]<2 then logic:=False else
  8. begin
  9. logic:=True;
  10. for uoc:=2 to a[i]-1 do
  11. if a[i] mod uoc = 0 then logic:=False;
  12. if logic = True then write(a[i],' ');
  13. end;
  14. END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement