Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROCEDURE SmanjiZa(st:CARDINAL; p: Polinom; VAR rez: Polinom);
- VAR pomoc, pret:Polinom;
- BEGIN
- Anuliraj(rez);
- IF p^.st > st THEN
- Kopiraj(p, rez);
- pomoc := rez;
- pret := NIL;
- WHILE (pomoc # NIL) AND (pomoc^.st >= st) DO
- pret := pomoc;
- pomoc := pomoc^.veza;
- END;
- IF pomoc#NIL THEN
- pret^.veza := NIL;
- DisposePolinom(pomoc);
- END;
- pomoc := rez;
- WHILE pomoc#NIL DO
- pomoc^.st := pomoc^.st - st;
- pomoc := pomoc^.veza;
- END;
- ELSIF p^.st = st THEN
- NEW(rez);
- rez^.st := 0;
- rez^.k := p^.k;
- rez^.veza := NIL;
- ELSE
- NEW(rez);
- rez^.st := 0;
- rez^.k := 0.0;
- rez^.veza := NIL;
- END;
- END SmanjiZa;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement