Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lol;
- var n,i,sqr,cube,a: integer;
- var issqr,iscube: boolean;
- begin
- read(n);
- i:=2;
- issqr:=false;
- iscube:=false;
- while (i*i<=n) and (not iscube) do
- begin
- sqr:=i*i;
- cube:=sqr*i;
- a:=1;
- while sqr*a<=n do
- begin
- if sqr*a=n then issqr:=true;
- if cube*a=n then iscube:=true;
- a:=a+1;
- end;
- i:=i+1;
- end;
- writeln(issqr and not iscube);
- end.
Add Comment
Please, Sign In to add comment