Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*Napisati program koji ucitava nizove A i B prirodnih brojeva sa n elemenata i ispisuje sve
- prirodne brojeve (a,b) gde je element niza B deli element niza A bez ostatka.*)
- MODULE bda;
- FROM InOut IMPORT WriteString, WriteLn, WriteCard, ReadCard;
- TYPE NIZ=ARRAY [1..100] OF CARDINAL;
- VAR a,b: NIZ;
- i,j,n,m: CARDINAL;
- BEGIN
- (*PRVI NIZ*)
- WriteString('Unesite broj elemenata prvog niza: ');
- ReadCard(n);
- WriteLn;
- WriteString('Unesite elemente prvog niza: ');
- FOR i:=1 TO n DO
- ReadCard(a[i]);
- WriteLn;
- END;
- WriteLn;
- (*DRUGI NIZ*)
- WriteString('Unesite broj elemenata drugog niza: ');
- ReadCard(m);
- WriteLn;
- WriteString('Unesite elemente drugog niza: ');
- FOR j:=1 TO m DO
- ReadCard(b[j]);
- WriteLn;
- END;
- WriteLn;
- (*DJELJIVO*)
- FOR i:=1 TO n DO
- FOR j:=1 TO m DO
- IF b[j] MOD a[i] =0 THEN
- WriteString('(');
- WriteCard(a[i],1);
- WriteString(',');
- WriteCard(b[j],1);
- WriteString(')');
- END;
- END;
- END;
- END bda.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement