Created
October 26, 2016 09:57
-
-
Save own2pwn/8f334c331d7aa5f0b27b65fba87db4ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program p1; | |
var | |
currX, xEnd, Y: Real; | |
begin | |
currX := -7; | |
xEnd := 7; | |
while currX <= xEnd do | |
begin | |
if (currX >= -7) and (currX <= -3) then begin | |
Y := 7 + currX; // �� 2� ������ | |
{ | |
(x+7) / (-3 +7) = (y-0) / (4-0) | |
} | |
writeln('X = ', currX:5, ' | Y = ', Y:5); | |
end | |
else if (currX > -3 ) and (currX <= -2) then begin | |
Y := 4;// | |
writeln('X = ', currX:5, ' | Y = ', Y:5); | |
end | |
else if (currX > -2) and (currX <= 2) then begin | |
y := currX * currX; | |
writeln('X = ', currX:5, ' | Y = ', Y:5); | |
end | |
else if (currX > 2) and (currX <= 4) then begin | |
y := 8 - (2 * currX); | |
writeln('X = ', currX:5, ' | Y = ', Y:5); | |
end | |
else if (currX > 4) and (currX < 7) then begin | |
y := 0; | |
writeln('X = ', currX:5, ' | Y = ', Y:5); | |
end; | |
currX := currX + 0.5; | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment