uses crt;
var h:real;
    x,y:integer;
    z:char;
begin
repeat
clrscr;
writeln('Trtkal 2008 - http://fei.trtkal.net');
writeln('-----------------------------------');
      repeat
      write('Zadej skok: ');readln(y);
      if y<=0 then writeln('Pouze kladne cele cislo!!!');
      until y>0;
      x:=-15;
      repeat
            if x<-5 then h:=-2*x-2;
            if x<=10 then h:=x+4;
            if x<=20 then h:=-2*x+26;
            if x>20 then writeln('Nedefinovana hodnota') else writeln('Hodnota H(x) pro x=',x:4,' je: ',h:5:1);
            x:=x+y;
      until x>=25;
writeln('----------');
write('Opakovat a/n: ');readln(z);
until (z='n');
end.
