Guest User

Untitled

a guest
Jan 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.40 KB | None | 0 0
  1. program lol;
  2.  
  3. var n,i,sqr,cube,a: integer;
  4. var issqr,iscube: boolean;
  5. begin
  6. read(n);
  7. i:=2;
  8. issqr:=false;
  9. iscube:=false;
  10. while (i*i<=n) and (not iscube) do
  11. begin
  12.    sqr:=i*i;
  13.    cube:=sqr*i;
  14.    a:=1;
  15.    while sqr*a<=n do
  16.      begin
  17.      if sqr*a=n then issqr:=true;
  18.      if cube*a=n then iscube:=true;
  19.      a:=a+1;
  20.      end;
  21.     i:=i+1;
  22.    end;
  23.   writeln(issqr and not iscube);
  24.  
  25. end.
Add Comment
Please, Sign In to add comment