Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MODULE nekevrste;
- FROM InOut IMPORT WriteLn, WriteString, WriteCard, ReadCard;
- TYPE matra= ARRAY [1..20], [1..20] OF CARDINAL;
- VAR m: matra;
- i,j,n,sum: CARDINAL;
- s: ARRAY [1..120] OF CARDINAL;
- BEGIN
- WriteString('Unesite dimenziju matrice: ');
- ReadCard(n);
- WriteLn;
- WriteString('Unesite matrice: ');
- WriteLn;
- FOR i:=1 TO n DO
- FOR j:=1 TO n DO
- ReadCard(m[i,j]);
- END;
- WriteLn;
- END;
- WriteString('Stampa matrice: ');
- WriteLn;
- FOR i:=1 TO n DO
- FOR j:=1 TO n DO
- WriteCard(m[i,j],5);
- END;
- WriteLn;
- END;
- FOR i:=1 TO n DO
- FOR j:=1 TO n DO
- s[i]:=s[i]+m[j,i];
- END;
- END;
- WriteLn;
- WriteString('Niz po kolonama izgleda ovako: ');
- FOR i:=1 TO n DO
- WriteCard(s[i],4);
- END;
- WriteLn;
- sum:=0;
- WriteString('Suma niza iznosi: ');
- FOR i:=1 TO n DO
- sum:=sum+s[i];
- END;
- WriteCard(sum,5);
- WriteLn;
- END nekevrste.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement