fork download
  1. //Шифрование Плэйфера
  2. function Playfair_Crypt(s,key:string):string;
  3. const
  4. //Размер ключевой матрицы:
  5. MaxX = 6;//столбцы
  6. MaxY = 5;//строки
  7. //Наш алфавит. Размер должен быть MaxY*MaxX.
  8. //Поэтому в нашем случае убраны буквы "ё", "й", "ь".
  9. URusA = 'абвгдежзиклмнопрстуфхцчшщъыэюя';
  10.  
  11. var i,j,t,x1,x2,y1,y2 :integer;
  12. M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
  13. temp :string;
  14.  
  15. //Функция поиска символа "с" в ключевой матрице.
  16. //Возвращает строку "y" и столбец "x".
  17. Procedure SimbolPos(c:char;var x,y:integer);
  18. var i,j:integer;
  19. begin
  20. x:=0;
  21. y:=0;
  22. for i := 1 to MaxY do
  23. for j := 1 to MaxX do
  24. if c=M[i,j] then
  25. begin
  26. x:=j;
  27. y:=i;
  28. end;
  29. end;
  30.  
  31. label M1;
  32. begin
  33. //переводим ключ и исходный текст в нижний регистр.
  34. key:=AnsiLowerCase(key);
  35. s:=AnsiLowerCase(s);
  36. //удаляем из строки все символы, не входящие в наш алфавит.
  37. temp:='';
  38. for i := 1 to length(s) do if pos(s[i],URusA)<>0 then temp:=temp+s[i];
  39. s:=temp;
  40. //Создание ключевой матрицы, с использованием ключевого слова "key".
  41. temp:='';
  42. for i:=1 to length(key) do
  43. if pos(key[i],temp)=0 then temp:=temp+key[i];
  44. for i:=1 to length(URusA) do
  45. if pos(URusA[i],temp)=0 then temp:=temp+URusA[i];
  46. t:=0;
  47. for i:=1 to 5 do
  48. for j:=1 to 6 do
  49. begin
  50. inc(t);
  51. M[i,j]:=temp[t];
  52. form1.StringGrid1.Cells[j,i]:=temp[t];
  53. end;
  54.  
  55.  
  56. //просмотр строки по парам символов и вставка разделяющего символа
  57. //"ъ" в случае когда в паре попались одинаковые символы.
  58. M1:
  59. for i:=1 to length(s)div 2 do
  60. begin
  61. if s[2*i-1]=s[2*i] then
  62. begin
  63. insert('ъ',s,2*i);
  64. goto M1;
  65. end;
  66. end;
  67. //Добавляем символ в конец строки, если её длина нечётная.
  68. if length(s) MOD 2 = 1 then if s[length(s)]<>'ъ' then s:=s+'ъ'
  69. else s:=s+'я';
  70. temp:='';
  71. for i:=1 to length(s)div 2 do
  72. begin
  73. SimbolPos(s[2*i-1],x1,y1);
  74. SimbolPos(s[2*i],x2,y2);
  75. //Правило 1
  76. if y1 = y2 then
  77. begin
  78. inc(x1); inc(x2);
  79. if x1 > MaxX then x1:=x1-MaxX;
  80. if x2 > MaxX then x2:=x2-MaxX;
  81. temp:=temp+M[y1,x1]+M[y2,x2];
  82. end;
  83. //Правило 2
  84. if x1 = x2 then
  85. begin
  86. inc(y1); inc(y2);
  87. if y1 > MaxY then y1:=y1-MaxY;
  88. if y2 > MaxY then y2:=y2-MaxY;
  89. temp:=temp+M[y1,x1]+M[y2,x2];
  90. end;
  91. //Правило 3
  92. if (x1<>x2) and (y1<>y2) then temp:=temp+M[y1,x2]+M[y2,x1];
  93. end;
  94. Playfair_Crypt:=temp;
  95. end;
  96.  
  97. //Дешифрование Плэйфера
  98. function Playfair_DeCrypt(s,key:string):string;
  99. const
  100. //Размер ключевой матрицы:
  101. MaxX = 6;//столбцы
  102. MaxY = 5;//строки
  103. //Наш алфавит. Размер должен быть MaxY*MaxX.
  104. //Поэтому в нашем случае убраны буквы "ё", "й", "ь".
  105. URusA = 'абвгдежзиклмнопрстуфхцчшщъыэюя';
  106.  
  107. var i,j,t,x1,x2,y1,y2 :integer;
  108. M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
  109. temp :string;
  110.  
  111. //Функция поиска символа "с" в ключевой матрице.
  112. //Возвращает строку "y" и столбец "x".
  113. Procedure SimbolPos(c:char;var x,y:integer);
  114. var i,j:integer;
  115. begin
  116. x:=0;
  117. y:=0;
  118. for i := 1 to MaxY do
  119. for j := 1 to MaxX do
  120. if c=M[i,j] then
  121. begin
  122. x:=j;
  123. y:=i;
  124. end;
  125. end;
  126.  
  127. label M1;
  128. begin
  129. //переводим ключ и исходный текст в нижний регистр.
  130. key:=AnsiLowerCase(key);
  131. s:=AnsiLowerCase(s);
  132. //удаляем из строки все символы, не входящие в наш алфавит.
  133. temp:='';
  134. for i := 1 to length(s) do
  135. begin
  136. if pos(s[i],URusA)<>0 then temp:=temp+s[i];
  137. end;
  138. s:=temp;
  139. //Создание ключевой матрицы, с использованием ключевого слова "key".
  140. temp:='';
  141. for i:=1 to length(key) do
  142. if pos(key[i],temp)=0 then temp:=temp+key[i];
  143. for i:=1 to length(URusA) do
  144. if pos(URusA[i],temp)=0 then temp:=temp+URusA[i];
  145. t:=0;
  146. for i:=1 to 5 do
  147. for j:=1 to 6 do
  148. begin
  149. inc(t);
  150. M[i,j]:=temp[t];
  151. end;
  152.  
  153. temp:='';
  154. for i:=1 to length(s)div 2 do
  155. begin
  156. SimbolPos(s[2*i-1],x1,y1);
  157. SimbolPos(s[2*i],x2,y2);
  158. //Правило 1
  159. if y1 = y2 then
  160. begin
  161. dec(x1); dec(x2);
  162. if x1 <= 0 then x1:=x1+MaxX;
  163. if x2 <= 0 then x2:=x2+MaxX;
  164. temp:=temp+M[y1,x1]+M[y2,x2];
  165. end;
  166. //Правило 2
  167. if x1 = x2 then
  168. begin
  169. dec(y1); dec(y2);
  170. if y1 <= 0 then y1:=y1+MaxY;
  171. if y2 <= 0 then y2:=y2+MaxY;
  172. temp:=temp+M[y1,x1]+M[y2,x2];
  173. end;
  174. //Правило 3
  175. if (x1<>x2) and (y1<>y2) then temp:=temp+M[y1,x2]+M[y2,x1];
  176. end;
  177. Playfair_DeCrypt:=temp;
  178. end;
  179.  
  180.  
  181.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:1: error: unknown type name ‘function’
 function Playfair_Crypt(s,key:string):string;
 ^~~~~~~~
prog.c:2:30: error: expected ‘)’ before ‘:’ token
 function Playfair_Crypt(s,key:string):string;
                              ^
prog.c:5:3: warning: type defaults to ‘int’ in declaration of ‘MaxX’ [-Wimplicit-int]
   MaxX = 6;//столбцы
   ^~~~
prog.c:6:3: warning: data definition has no type or storage class
   MaxY = 5;//строки
   ^~~~
prog.c:6:3: warning: type defaults to ‘int’ in declaration of ‘MaxY’ [-Wimplicit-int]
prog.c:9:3: warning: data definition has no type or storage class
   URusA = 'абвгдежзиклмнопрстуфхцчшщъыэюя';
   ^~~~~
prog.c:9:3: warning: type defaults to ‘int’ in declaration of ‘URusA’ [-Wimplicit-int]
prog.c:9:11: warning: character constant too long for its type
   URusA = 'абвгдежзиклмнопрстуфхцчшщъыэюя';
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:11:1: error: unknown type name ‘var’
 var i,j,t,x1,x2,y1,y2 :integer;
 ^~~
prog.c:11:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 var i,j,t,x1,x2,y1,y2 :integer;
                       ^
prog.c:12:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
       ^
prog.c:12:15: error: too many decimal points in number
     M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
               ^~~~~~~
prog.c:12:23: error: too many decimal points in number
     M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
                       ^~~~~~~
prog.c:13:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     temp :string;
          ^
prog.c:17:3: error: unknown type name ‘Procedure’
   Procedure SimbolPos(c:char;var x,y:integer);
   ^~~~~~~~~
prog.c:17:24: error: expected ‘)’ before ‘:’ token
   Procedure SimbolPos(c:char;var x,y:integer);
                        ^
prog.c:18:3: error: unknown type name ‘var’
   var i,j:integer;
   ^~~
prog.c:18:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
   var i,j:integer;
          ^
prog.c:19:3: error: unknown type name ‘begin’
   begin
   ^~~~~
prog.c:20:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
   x:=0;
    ^
prog.c:21:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
   y:=0;
    ^
prog.c:22:3: error: expected identifier or ‘(’ before ‘for’
   for i := 1 to MaxY do
   ^~~
prog.c:27:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
         y:=i;
          ^
prog.c:28:9: warning: data definition has no type or storage class
         exit;
         ^~~~
prog.c:28:9: warning: type defaults to ‘int’ in declaration of ‘exit’ [-Wimplicit-int]
prog.c:28:9: warning: built-in function ‘exit’ declared as non-function
prog.c:29:9: warning: data definition has no type or storage class
         end;
         ^~~
prog.c:29:9: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:30:3: warning: data definition has no type or storage class
   end;
   ^~~
prog.c:30:3: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:32:1: error: unknown type name ‘label’
 label M1;
 ^~~~~
prog.c:33:1: error: unknown type name ‘begin’
 begin
 ^~~~~
prog.c:35:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 key:=AnsiLowerCase(key);
    ^
prog.c:36:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 s:=AnsiLowerCase(s);
  ^
prog.c:38:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 temp:='';
     ^
prog.c:38:7: error: empty character constant
 temp:='';
       ^~
prog.c:39:1: error: expected identifier or ‘(’ before ‘for’
 for i := 1 to length(s) do if pos(s[i],URusA)<>0 then temp:=temp+s[i];
 ^~~
prog.c:40:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 s:=temp;
  ^
prog.c:42:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 temp:='';
     ^
prog.c:42:7: error: empty character constant
 temp:='';
       ^~
prog.c:43:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to length(key) do
 ^~~
prog.c:45:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to length(URusA) do
 ^~~
prog.c:47:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 t:=0;
  ^
prog.c:48:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to 5 do
 ^~~
prog.c:52:5: error: expected ‘]’ before ‘,’ token
  M[i,j]:=temp[t];
     ^
prog.c:53:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
  form1.StringGrid1.Cells[j,i]:=temp[t];
       ^
prog.c:54:2: warning: data definition has no type or storage class
  end;
  ^~~
prog.c:54:2: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:59:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 M1:
   ^
prog.c:64:12: warning: multi-character character constant [-Wmultichar]
     insert('ъ',s,2*i);
            ^~~~
prog.c:65:5: error: expected identifier or ‘(’ before ‘goto’
     goto M1;
     ^~~~
prog.c:66:5: warning: data definition has no type or storage class
     end;
     ^~~
prog.c:66:5: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:67:3: warning: data definition has no type or storage class
   end;
   ^~~
prog.c:67:3: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:69:1: error: expected identifier or ‘(’ before ‘if’
 if length(s) MOD 2 = 1 then if s[length(s)]<>'ъ' then s:=s+'ъ'
 ^~
prog.c:69:46: warning: multi-character character constant [-Wmultichar]
 if length(s) MOD 2 = 1 then if s[length(s)]<>'ъ' then s:=s+'ъ'
                                              ^~~~
prog.c:69:61: warning: multi-character character constant [-Wmultichar]
 if length(s) MOD 2 = 1 then if s[length(s)]<>'ъ' then s:=s+'ъ'
                                                             ^~~~
prog.c:70:60: warning: multi-character character constant [-Wmultichar]
                                                  else s:=s+'я';
                                                            ^~~~
prog.c:71:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 temp:='';
     ^
prog.c:71:7: error: empty character constant
 temp:='';
       ^~
prog.c:72:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to length(s)div 2 do
 ^~~
prog.c:75:13: error: unknown type name ‘s’
   SimbolPos(s[2*i],x2,y2);
             ^
prog.c:75:20: error: expected declaration specifiers or ‘...’ before ‘x2’
   SimbolPos(s[2*i],x2,y2);
                    ^~
prog.c:75:23: error: unknown type name ‘y2’
   SimbolPos(s[2*i],x2,y2);
                       ^~
prog.c:77:3: error: expected identifier or ‘(’ before ‘if’
   if y1 = y2 then
   ^~
prog.c:79:14: warning: data definition has no type or storage class
     inc(x1); inc(x2);
              ^~~
prog.c:79:14: warning: type defaults to ‘int’ in declaration of ‘inc’ [-Wimplicit-int]
prog.c:79:5: warning: parameter names (without types) in function declaration
     inc(x1); inc(x2);
     ^~~
prog.c:80:5: error: expected identifier or ‘(’ before ‘if’
     if x1 > MaxX then x1:=x1-MaxX;
     ^~
prog.c:81:5: error: expected identifier or ‘(’ before ‘if’
     if x2 > MaxX then x2:=x2-MaxX;
     ^~
prog.c:82:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     temp:=temp+M[y1,x1]+M[y2,x2];
         ^
prog.c:83:5: warning: data definition has no type or storage class
     end;
     ^~~
prog.c:83:5: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:85:3: error: expected identifier or ‘(’ before ‘if’
   if x1 = x2 then
   ^~
prog.c:87:14: warning: data definition has no type or storage class
     inc(y1); inc(y2);
              ^~~
prog.c:87:14: warning: type defaults to ‘int’ in declaration of ‘inc’ [-Wimplicit-int]
prog.c:87:5: warning: parameter names (without types) in function declaration
     inc(y1); inc(y2);
     ^~~
prog.c:88:5: error: expected identifier or ‘(’ before ‘if’
     if y1 > MaxY then y1:=y1-MaxY;
     ^~
prog.c:89:5: error: expected identifier or ‘(’ before ‘if’
     if y2 > MaxY then y2:=y2-MaxY;
     ^~
prog.c:90:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     temp:=temp+M[y1,x1]+M[y2,x2];
         ^
prog.c:91:5: warning: data definition has no type or storage class
     end;
     ^~~
prog.c:91:5: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:93:3: error: expected identifier or ‘(’ before ‘if’
   if (x1<>x2) and (y1<>y2) then temp:=temp+M[y1,x2]+M[y2,x1];
   ^~
prog.c:94:3: warning: data definition has no type or storage class
   end;
   ^~~
prog.c:94:3: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:95:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 Playfair_Crypt:=temp;
               ^
prog.c:96:1: warning: data definition has no type or storage class
 end;
 ^~~
prog.c:96:1: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:99:1: error: unknown type name ‘function’
 function Playfair_DeCrypt(s,key:string):string;
 ^~~~~~~~
prog.c:99:32: error: expected ‘)’ before ‘:’ token
 function Playfair_DeCrypt(s,key:string):string;
                                ^
prog.c:102:3: warning: type defaults to ‘int’ in declaration of ‘MaxX’ [-Wimplicit-int]
   MaxX = 6;//столбцы
   ^~~~
prog.c:102:3: error: redefinition of ‘MaxX’
prog.c:5:3: note: previous definition of ‘MaxX’ was here
   MaxX = 6;//столбцы
   ^~~~
prog.c:103:3: warning: data definition has no type or storage class
   MaxY = 5;//строки
   ^~~~
prog.c:103:3: warning: type defaults to ‘int’ in declaration of ‘MaxY’ [-Wimplicit-int]
prog.c:103:3: error: redefinition of ‘MaxY’
prog.c:6:3: note: previous definition of ‘MaxY’ was here
   MaxY = 5;//строки
   ^~~~
prog.c:106:3: warning: data definition has no type or storage class
   URusA = 'абвгдежзиклмнопрстуфхцчшщъыэюя';
   ^~~~~
prog.c:106:3: warning: type defaults to ‘int’ in declaration of ‘URusA’ [-Wimplicit-int]
prog.c:106:3: error: redefinition of ‘URusA’
prog.c:9:3: note: previous definition of ‘URusA’ was here
   URusA = 'абвгдежзиклмнопрстуфхцчшщъыэюя';
   ^~~~~
prog.c:106:11: warning: character constant too long for its type
   URusA = 'абвгдежзиклмнопрстуфхцчшщъыэюя';
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:108:1: error: unknown type name ‘var’
 var i,j,t,x1,x2,y1,y2 :integer;
 ^~~
prog.c:108:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 var i,j,t,x1,x2,y1,y2 :integer;
                       ^
prog.c:109:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
       ^
prog.c:109:15: error: too many decimal points in number
     M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
               ^~~~~~~
prog.c:109:23: error: too many decimal points in number
     M : array[1..MaxY,1..MaxX]of char; //ключевая матрица
                       ^~~~~~~
prog.c:110:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     temp :string;
          ^
prog.c:114:3: error: unknown type name ‘Procedure’
   Procedure SimbolPos(c:char;var x,y:integer);
   ^~~~~~~~~
prog.c:114:24: error: expected ‘)’ before ‘:’ token
   Procedure SimbolPos(c:char;var x,y:integer);
                        ^
prog.c:115:3: error: unknown type name ‘var’
   var i,j:integer;
   ^~~
prog.c:115:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
   var i,j:integer;
          ^
prog.c:116:3: error: unknown type name ‘begin’
   begin
   ^~~~~
prog.c:117:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
   x:=0;
    ^
prog.c:118:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
   y:=0;
    ^
prog.c:119:3: error: expected identifier or ‘(’ before ‘for’
   for i := 1 to MaxY do
   ^~~
prog.c:124:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
         y:=i;
          ^
prog.c:125:9: warning: data definition has no type or storage class
         exit;
         ^~~~
prog.c:125:9: warning: type defaults to ‘int’ in declaration of ‘exit’ [-Wimplicit-int]
prog.c:126:9: warning: data definition has no type or storage class
         end;
         ^~~
prog.c:126:9: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:127:3: warning: data definition has no type or storage class
   end;
   ^~~
prog.c:127:3: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:129:1: error: unknown type name ‘label’
 label M1;
 ^~~~~
prog.c:130:1: error: unknown type name ‘begin’
 begin
 ^~~~~
prog.c:132:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 key:=AnsiLowerCase(key);
    ^
prog.c:133:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 s:=AnsiLowerCase(s);
  ^
prog.c:135:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 temp:='';
     ^
prog.c:135:7: error: empty character constant
 temp:='';
       ^~
prog.c:136:1: error: expected identifier or ‘(’ before ‘for’
 for i := 1 to length(s) do
 ^~~
prog.c:139:3: warning: data definition has no type or storage class
   end;
   ^~~
prog.c:139:3: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:140:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 s:=temp;
  ^
prog.c:142:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 temp:='';
     ^
prog.c:142:7: error: empty character constant
 temp:='';
       ^~
prog.c:143:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to length(key) do
 ^~~
prog.c:145:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to length(URusA) do
 ^~~
prog.c:147:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 t:=0;
  ^
prog.c:148:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to 5 do
 ^~~
prog.c:152:5: error: expected ‘]’ before ‘,’ token
  M[i,j]:=temp[t];
     ^
prog.c:153:2: warning: data definition has no type or storage class
  end;
  ^~~
prog.c:153:2: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:155:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 temp:='';
     ^
prog.c:155:7: error: empty character constant
 temp:='';
       ^~
prog.c:156:1: error: expected identifier or ‘(’ before ‘for’
 for i:=1 to length(s)div 2 do
 ^~~
prog.c:159:13: error: unknown type name ‘s’
   SimbolPos(s[2*i],x2,y2);
             ^
prog.c:159:20: error: expected declaration specifiers or ‘...’ before ‘x2’
   SimbolPos(s[2*i],x2,y2);
                    ^~
prog.c:159:23: error: unknown type name ‘y2’
   SimbolPos(s[2*i],x2,y2);
                       ^~
prog.c:161:3: error: expected identifier or ‘(’ before ‘if’
   if y1 = y2 then
   ^~
prog.c:163:14: warning: data definition has no type or storage class
     dec(x1); dec(x2);
              ^~~
prog.c:163:14: warning: type defaults to ‘int’ in declaration of ‘dec’ [-Wimplicit-int]
prog.c:163:5: warning: parameter names (without types) in function declaration
     dec(x1); dec(x2);
     ^~~
prog.c:164:5: error: expected identifier or ‘(’ before ‘if’
     if x1 <= 0 then x1:=x1+MaxX;
     ^~
prog.c:165:5: error: expected identifier or ‘(’ before ‘if’
     if x2 <= 0 then x2:=x2+MaxX;
     ^~
prog.c:166:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     temp:=temp+M[y1,x1]+M[y2,x2];
         ^
prog.c:167:5: warning: data definition has no type or storage class
     end;
     ^~~
prog.c:167:5: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:169:3: error: expected identifier or ‘(’ before ‘if’
   if x1 = x2 then
   ^~
prog.c:171:14: warning: data definition has no type or storage class
     dec(y1); dec(y2);
              ^~~
prog.c:171:14: warning: type defaults to ‘int’ in declaration of ‘dec’ [-Wimplicit-int]
prog.c:171:5: warning: parameter names (without types) in function declaration
     dec(y1); dec(y2);
     ^~~
prog.c:172:5: error: expected identifier or ‘(’ before ‘if’
     if y1 <= 0 then y1:=y1+MaxY;
     ^~
prog.c:173:5: error: expected identifier or ‘(’ before ‘if’
     if y2 <= 0 then y2:=y2+MaxY;
     ^~
prog.c:174:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
     temp:=temp+M[y1,x1]+M[y2,x2];
         ^
prog.c:175:5: warning: data definition has no type or storage class
     end;
     ^~~
prog.c:175:5: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:177:3: error: expected identifier or ‘(’ before ‘if’
   if (x1<>x2) and (y1<>y2) then temp:=temp+M[y1,x2]+M[y2,x1];
   ^~
prog.c:178:3: warning: data definition has no type or storage class
   end;
   ^~~
prog.c:178:3: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
prog.c:179:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 Playfair_DeCrypt:=temp;
                 ^
prog.c:180:1: warning: data definition has no type or storage class
 end;
 ^~~
prog.c:180:1: warning: type defaults to ‘int’ in declaration of ‘end’ [-Wimplicit-int]
stdout
Standard output is empty