gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
Uvod o fajlovima i slika 'trake'
[spa1skripta-public.git] / kodovi / polinomi / PolSuma.MOD
1 MODULE PolSuma;
2 (* Napisati program koji ucitava broj k (1 <= k <= 50) i k polinoma, a nakon toga izracunava njihovu sumu *)
4 FROM PolinomL IMPORT Polinom, Anuliraj, DisposePolinom,
5 Unos, Stampaj, SaberiNa;
6 FROM InOut IMPORT WriteLn, WriteString, ReadCard, WriteCard;
7 CONST
8 maxk = 50;
9 TYPE
10 nizPol = ARRAY [1..maxk] OF Polinom;
11 VAR
12 i, k: CARDINAL;
13 suma : Polinom;
14 p : nizPol;
15 BEGIN
16 REPEAT
17 WriteString('Unesite broj k (1 <= k <= ');
18 WriteCard(maxk, 1);
19 WriteString(') ');
20 ReadCard(k);
21 WriteLn;
22 UNTIL (1 <= k) AND (k <= maxk);
23 FOR i := 1 TO k DO
24 WriteLn;
25 WriteString('Unos ');
26 WriteCard(i, 1);
27 WriteString('. polinoma.');
28 WriteLn;
29 Unos(p[i])
30 END;
31 Anuliraj(suma);
32 FOR i := 1 TO k DO
33 SaberiNa(p[i], suma)
34 END;
35 WriteLn;
36 WriteString('Njihova suma je:');
37 WriteLn;
38 Stampaj(suma, 4);
39 DisposePolinom(suma);
40 FOR i := 1 TO k DO
41 DisposePolinom(p[i]);
42 END;
43 END PolSuma.
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner