Advertisement
smay

Untitled

Feb 2nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.78 KB | None | 0 0
  1. program Vvod_Vivod;
  2.  
  3. var
  4.  
  5.   i, n,z: integer;
  6.   f, t: text;
  7.   l, k: string;
  8.  
  9. begin
  10. z:=1;
  11. assign(t, 'd:\input.txt');
  12.   reset(t);
  13.  
  14.   assign(f, 'output.txt');
  15.   reset(f);
  16.  
  17. Repeat
  18.    readln(t, l);
  19.    readln(f, k);
  20. if length(l)<length(k) then
  21. repeat
  22. l:=l+' ';
  23. until(length(l)=length(k));  
  24. if length(l)>length(k) then
  25. repeat
  26. k:=k+' ';
  27. until(length(k)=length(l));  
  28.     for i:=1 to length(l) do
  29.     begin
  30.       if not(l[i] = k[i]) then
  31.       begin
  32.         n := i;
  33.         break;
  34.       end
  35.       else n:=0;
  36.     end;
  37.     If n>0 then
  38.   writeln('В ', z, ' строке отличие начиная с ', n:2, ' элемента')
  39.   else writeln('В ' , z, ' строке отличий нет');
  40.  z:=z+1;
  41.  Until Eof(t) and Eof(f);
  42.  close(t);
  43.  close(f);
  44. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement