fork download
  1. program ideone;
  2.  
  3. function normalize (n: real): byte;
  4. begin
  5. if n <> 0 then
  6. if n > 0 then
  7. normalize := 2
  8. else
  9. normalize := 0
  10. else
  11. normalize := 1
  12. end;
  13.  
  14. procedure print_sector(x,y : real);
  15. begin
  16. case (normalize(x) * 3 + normalize(y)) of
  17. 0: writeln('left bottom');
  18. 1: writeln('left center');
  19. 2: writeln('left top');
  20. 3: writeln('center bottom');
  21. 4: writeln('center center');
  22. 5: writeln('center top');
  23. 6: writeln('right bottom');
  24. 7: writeln('right center');
  25. 8: writeln('right top');
  26. end;
  27.  
  28. end;
  29.  
  30. var x,y: real;
  31. begin
  32. x:=1; y:=-1;
  33. print_sector(x, y);
  34. end.
  35.  
Success #stdin #stdout 0s 232KB
stdin
Standard input is empty
stdout
right bottom