Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (* ucitava 2 stringa i ispisuje da li su jednaki(nije case sensitive)*)
- MODULE rz51;
- FROM InOut IMPORT ReadString, WriteString, WriteLn;
- FROM Str IMPORT Length;
- TYPE NIZ = ARRAY [1..256] OF CHAR;
- VAR str1,str2: NIZ;
- prost,duz: BOOLEAN;
- i: CARDINAL;
- BEGIN
- WriteString('Unesite prvu rijec: ');
- ReadString(str1);
- WriteLn;
- WriteString('Unesite drugu rijec: ');
- ReadString(str2);
- WriteLn;
- duz:=TRUE;
- IF Length(str1) # Length(str2) THEN
- duz:=FALSE;
- END;
- i:=1;
- WHILE (str1[i] #0C) AND (str2[i] #0C) DO
- str1[i] := CAP(str1[i]);
- str2[i] := CAP(str2[i]);
- INC(i);
- END;
- prost:=TRUE;
- i:=1;
- WHILE (str1[i] # 0C) AND (str2[i] # 0C) AND prost DO
- IF (str1[i] = str2[i]) THEN
- INC(i);
- ELSE
- prost:=FALSE;
- END;
- END;
- IF prost AND duz THEN
- WriteString('Rijeci su iste.');
- ELSE
- WriteString('Rijeci nisu iste.');
- END;
- WriteLn;
- END rz51.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement