gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4368ee3)
raw | patch | inline | side by side (parent: 4368ee3)
author | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 18 Feb 2013 18:58:36 +0000 (19:58 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 18 Feb 2013 18:58:36 +0000 (19:58 +0100) |
skripta-spa1.tex | patch | blob | history |
diff --git a/skripta-spa1.tex b/skripta-spa1.tex
index f8923ee92bbeeaddc2a81d2a3230cb91e9a86d11..a3a387f7ed368a6c47a697b8cdd21db8b8086c12 100644 (file)
--- a/skripta-spa1.tex
+++ b/skripta-spa1.tex
\paragraph{PolinomL.MOD} \
\begin{codeblock}
+(* Modul za rad sa polinomima preko listi
+ verzija 2012, rev 1 *)
IMPLEMENTATION MODULE PolinomL;
FROM InOut IMPORT Write, WriteString, WriteLn,
WriteCard, ReadCard, Done;
PROCEDURE Anuliraj(VAR p: Polinom);
BEGIN
- IF p # NIL THEN
- DisposePolinom(p);
- END;
+ p := NIL;
END Anuliraj;
-PROCEDURE Kopiraj(p: Polinom;
- VAR kopija: Polinom);
+PROCEDURE Kopiraj(p: Polinom; VAR kopija: Polinom);
VAR
pomocni: Polinom;
BEGIN
END
END Stampaj;
-PROCEDURE UbaciMonom(mon :Polinom;
- VAR p: Polinom);
+PROCEDURE UbaciMonom(mon:Polinom; VAR p: Polinom);
VAR
stari, tekuci, kopija: Polinom;
BEGIN
ELSE
stari^.veza := kopija
END;
- IF (tekuci#NIL) AND
- (kopija^.st = tekuci^.st) THEN
+ IF (tekuci#NIL) AND (kopija^.st = tekuci^.st) THEN
kopija^.k := kopija^.k + tekuci^.k;
kopija^.veza := tekuci^.veza;
DISPOSE(tekuci);
NEW(novi);
WITH novi^ DO
REPEAT
- WriteString('koeficijent monoma br.');
+ WriteString('Unesite koeficijent monoma br.');
WriteCard(i, 1);
- WriteString(' (<> 0):');
+ WriteString(' (<> 0) ');
ReadReal(k);
WriteLn
UNTIL k <> 0.0;
REPEAT
WriteLn;
- WriteString('eksponent monoma br.');
+ WriteString('Unesite eksponent monoma br.');
WriteCard(i, 1);
- WriteString(' (>= 0): ');
+ WriteString(' (>=0) ');
ReadCard(st);
UNTIL Done;
WriteLn;
END
END Unos;
-PROCEDURE Saberi(p1, p2: Polinom;
- VAR zbir: Polinom);
+PROCEDURE Saberi(p1, p2: Polinom; VAR zbir: Polinom);
BEGIN
Kopiraj(p1, zbir);
WHILE p2 <> NIL DO
END
END Saberi;
-PROCEDURE SaberiNa(p: Polinom;
- VAR rez: Polinom);
+PROCEDURE SaberiNa(p: Polinom; VAR rez: Polinom);
BEGIN
WHILE p <> NIL DO
UbaciMonom(p,rez);
END
END PromeniZnak;
-PROCEDURE Oduzmi(p1,p2: Polinom;
- VAR razlika: Polinom);
+PROCEDURE Oduzmi(p1,p2: Polinom; VAR razlika: Polinom);
BEGIN
Kopiraj(p2, razlika);
PromeniZnak(razlika);
END
END Oduzmi;
-PROCEDURE MonomPuta(p, mon: Polinom;
- VAR mp: Polinom);
+PROCEDURE MonomPuta(p, mon: Polinom; VAR mp: Polinom);
VAR
tekuci: Polinom;
BEGIN
END
END Puta;
-PROCEDURE Kolicnik(p1, p2: Polinom;
- VAR kol, ost: Polinom;
- VAR ok: BOOLEAN);
+PROCEDURE Kolicnik(p1, p2: Polinom; VAR kol, ost: Polinom; VAR ok: BOOLEAN);
PROCEDURE Deli(VAR kol, ost: Polinom);
VAR
rez^.st := 0;
rez^.veza := NIL;
ELSIF n = 1 THEN
- Kopiraj( rez, p );
+ Kopiraj( p, rez );
ELSE
rez := p;
FOR i := 2 TO n DO