Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MODULE zad42;
- FROM InOut IMPORT WriteLn, WriteString, WriteInt, WriteCard, ReadCard, ReadString;
- CONST max=256;
- TYPE string= ARRAY [1..max] OF CHAR;
- VAR i:INTEGER;
- string1, string2: string;
- jednak: BOOLEAN;
- BEGIN
- WriteString('Unesite prvi string: ');
- ReadString(string1);
- WriteLn;
- WriteString('Unesite drugi string: ');
- ReadString(string2);
- WriteLn;
- i:=1;
- jednak:=TRUE;
- string1[i]:= CAP(string1[i]);
- string2[i]:= CAP(string2[i]);
- WHILE (string1[i] # 0C) AND (string2[i] # 0C) AND jednak DO
- IF string1[i]=string2[i] THEN
- INC(i);
- ELSE
- jednak:=FALSE;
- END;
- END;
- IF jednak THEN
- WriteString('Stringovi su jednaki. ');
- ELSE
- WriteString('Stringovi nisu jednaki. ');
- END;
- WriteLn;
- END zad42.
- (* string1[i]:=CHR(ORD(string1[i])+ORD('a')-ORD('A'));
- string2[i]:=CHR(ORD(string2[i])+ORD('a')-ORD('A')); *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement