All pastes #361000 Raw Edit

Something

public text v1 · immutable
·published 2007-02-17 21:28 UTC
rendered paste body
{Robertas Jurkaitis, 8 grupe, uzduotis 2, variantas 18}
program uzduotis2;
uses crt, graph;
var x,y,tvrk,skg:integer;
    x0,y0,z:real;
    k:string;
    t:boolean;
begin
    t:=true;
    while t do
    begin
        clrscr;
        writeln('Iveskite tasko koordinates: ');
        read(x,y);
        tvrk:=DETECT;
        InitGraph(tvrk,skg, ' ');
        skg:=0;

        x0:=x;
        y0:=y;
        x:=x*35;
        y:=y*35;

        SetFillStyle(12,3);                    //langas
        Bar(0,0,1024,768);

        SetColor(8);                           //skritulys
        SetFillStyle(4,8);
        SetLineStyle(0,0,3);
        Circle(512,384,100);
        FloodFill(512,384,8);

        SetColor(14);                          //taskas
        SetFillStyle(1,14);
        Circle(512+x,384-y,2);
        FloodFill(512+x,384-y,14);

        SetColor(0);                           //koord. linijos
        SetLineStyle(0,0,1);
        Line(20,384,1004,384);
        Line(512,20,512,692);

        Line(1004,384,994,379);                 //rodykles
        Line(1004,384,994,389);
        Line(512,20,507,30);
        Line(512,20,517,30);

        OutTextXY(1000,388,'x');                //raides
        OutTextXY(500,18,'y');

        OutTextXY(616,388,'3');                 //koord. skaiciai
        OutTextXY(394,388,'-3');
        OutTextXY(502,274,'3');
        OutTextXY(495,490,'-3');

        if (sqrt(sqr(x0)+sqr(y0)))<3 then
        begin
            z:=(sqrt(sqr(x0)+sqr(y0)));
            writeln('Taskas patenka i uzstrichuota sriti');
            writeln('Atstumas iki koordinaciu pradzios = ',z:4:3);
            SetColor(14);
            SetLineStyle(3,0,3);
            Line(512,384,512+x,384-y);
        end
        else
        begin
            z:=(sqrt(sqr(x0)+sqr(y0)))-3;
            writeln('Taskas nepatenka i uzstrichuota sriti');
            writeln('Atstumas iki figuros = ',z:4:3);
            SetColor(14);
            SetLineStyle(3,0,3);
            Line(512,384,512+x,384-y);
        end;
    writeln('Jei norite pakartoti spauskite "y"');
    writeln('Jei ne - spauskite bet kuri kita klavisa');
    k:=readkey;
    if k='y' then t:=true
    else t:=false;
    CloseGraph;
    end;
end.