Advertisement
MoonDeMon

complex3

Feb 24th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. program complex3;
  2. var n,i,x,cek,faktor:0..1000000;
  3. begin
  4. readln(n);
  5. for i:=1 to n do
  6. begin
  7. readln(x);
  8. faktor:=0;
  9. cek:=2;
  10. if (x=1) or (x=2) or (x=4) then
  11. begin
  12. writeln('YA');
  13. end
  14. else
  15. begin
  16.  
  17. while (cek<=trunc(x/2)+1) do
  18. begin
  19. if(x mod cek=0) then
  20. begin
  21. faktor:=faktor+1;
  22. if (faktor>2) then
  23. begin
  24. writeln('BUKAN');
  25. break;
  26. end;
  27. end
  28. else
  29. begin
  30. if (cek=trunc(x/2)+1) then
  31. begin
  32. writeln('YA');
  33. break;
  34. end;
  35. end;
  36. cek:=cek+1;
  37. end;
  38. end;
  39. end;
  40. readln;
  41. readln;
  42. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement