Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MODULE zad41;
- FROM InOut IMPORT WriteLn, WriteString, WriteInt, ReadInt, WriteCard,ReadCard;
- FROM RealInOut IMPORT WriteReal, ReadReal;
- CONST
- max=100;
- TYPE
- Niz = ARRAY [1..max] OF INTEGER;
- VAR
- n, i: CARDINAL;
- sum,as: REAL;
- niz: Niz;
- BEGIN
- WriteString('unesite duzinu niza: ');
- ReadCard(n);
- FOR i:=1 TO n DO
- WriteString('niz[');
- WriteCard(i,1);
- WriteString('] = ');
- ReadInt(niz[i]);
- END;
- WriteString('Niz izgleda ovako: ');
- WriteLn;
- FOR i:=1 TO n DO
- WriteString('niz[');
- WriteCard(i,1);
- WriteString('] = ');
- WriteInt(niz[i],0);
- WriteLn;
- END;
- sum:=0.;
- FOR i:=1 TO n DO
- sum:=sum+FLOAT(niz[i]);
- END;
- WriteString('Arhimeticka sredina sume je: ');
- as:=sum / FLOAT(n);
- WriteReal(as,0);
- END zad41.
Add Comment
Please, Sign In to add comment