Advertisement
ridjis

zadatak 42_2

Nov 18th, 2013
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MODULE zad42o5;
  2. FROM InOut IMPORT ReadString, WriteString, WriteLn, WriteCard;
  3. CONST max=256;
  4. TYPE string= ARRAY [1..max] OF CHAR;
  5. VAR str1, str2: string;
  6. i: CARDINAL;
  7. jednak: BOOLEAN;
  8. BEGIN
  9.     WriteString('Unesite 1. string: ');
  10.         ReadString(str1);
  11.     WriteLn;
  12.     WriteString('Unesite 2. string: ');
  13.     ReadString(str2);
  14.     WriteLn;
  15.    
  16.    
  17.         i:=1;
  18.     WHILE (str1[i] #0C) AND (str2[i] #0C) DO
  19.         INC(i);
  20.         str1[i] := CAP(str1[i]);
  21.         str2[i] := CAP(str2[i]);
  22.     END;
  23.     jednak:=TRUE;
  24.         WHILE (str1[i] #0C) AND (str2[i] #0C) AND jednak DO
  25.         IF str1[i] = str2[i] THEN
  26.             INC(i);
  27.         ELSE
  28.             jednak:= FALSE;
  29.         END;
  30.     END;
  31.     IF jednak THEN
  32.         WriteString('jednaki');
  33.     ELSE
  34.         WriteString('nisu jednaki');
  35.     END;
  36.  
  37. END zad42o5.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement