Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MODULE zad42o5;
- FROM InOut IMPORT ReadString, WriteString, WriteLn, WriteCard;
- CONST max=256;
- TYPE string= ARRAY [1..max] OF CHAR;
- VAR str1, str2: string;
- i: CARDINAL;
- jednak: BOOLEAN;
- BEGIN
- WriteString('Unesite 1. string: ');
- ReadString(str1);
- WriteLn;
- WriteString('Unesite 2. string: ');
- ReadString(str2);
- WriteLn;
- i:=1;
- WHILE (str1[i] #0C) AND (str2[i] #0C) DO
- INC(i);
- str1[i] := CAP(str1[i]);
- str2[i] := CAP(str2[i]);
- END;
- jednak:=TRUE;
- WHILE (str1[i] #0C) AND (str2[i] #0C) AND jednak DO
- IF str1[i] = str2[i] THEN
- INC(i);
- ELSE
- jednak:= FALSE;
- END;
- END;
- IF jednak THEN
- WriteString('jednaki');
- ELSE
- WriteString('nisu jednaki');
- END;
- END zad42o5.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement