1 solutions

  • 0
    @ 2025-11-5 15:18:46

    Pascal :

    var
    s:string;
    a:array[1..100]of string;
    i,j,t,m,h,k:integer;
    begin
     readln(s);
     t:=length(s);
     for i:=1 to t-1 do
     begin
      m:=i+1;
      for j:=1 to m do a[j]:=copy(s,j,t-i);
      for h:=1 to m do
      for k:=1 to m do
      if (a[h]=a[k])and(h<>k) then begin writeln(a[k]);writeln(h);exit;end;
     end;
    end.
    
    • 1

    Information

    ID
    16640
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By