paprikodlak

Určování polohy bodu

Mar 28th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.51 KB | None | 0 0
  1. program bod;
  2. var
  3. a,b,q:real;
  4.  
  5. begin
  6. writeln('X[a,b]'); writeln('x ='); readln(a); writeln('y ='); readln(b);
  7.  
  8. if a=0
  9.   then if b=0 then writeln('[0,0]')
  10.         else writeln('y')
  11.   else if a<>0
  12.           then if b=0 then writeln('x')
  13.               else
  14.                 begin
  15.                  if a>0 then if b>0 then q:=1 else q:=4
  16.                     else if b>0 then q:=2 else q:=3;
  17.                  writeln('Bod leží v kvadrantu číslo ',q:1:0,'.');
  18.                 end;  
  19.  
  20.  
  21. readln();
  22.  
  23.  
  24. end.
Advertisement
Add Comment
Please, Sign In to add comment