fork download
  1. program decompose;
  2. uses crt;
  3. var x,i,p,k:integer; v:array[1..100] of integer; test:boolean;
  4.  
  5. function premier(x:integer):boolean;
  6. var test:boolean; z:integer;
  7. begin
  8. test:= true; if (x=1) then test:=false;
  9. for z:=2 to (x-1) do begin
  10. if (x mod z=0) then test:=false;
  11. end;
  12. premier:=test; end;
  13.  
  14. begin
  15. readln(x); i:=1; p:=0;
  16. repeat i:=i+1; test:=false;
  17. if (premier(i)=true) then begin
  18. if (x mod i=0) then begin
  19. p:=p+1;
  20. v[p]:=i;
  21. x:=x div i;
  22. i:=i-1;
  23. end;
  24. end;
  25. until (i>x);
  26. for k:=1 to p-1 do begin
  27. if (v[k]=v[k+1]) then test:=true;
  28. end; writeln(test);
  29. end.
  30.  
Success #stdin #stdout 0s 372KB
stdin
22
stdout
FALSE