1 solutions

  • 0
    @ 2024-12-20 22:52:19

    Pascal :

    var a:array['a'..'z'] of char; 
        i,n:longint; 
        st:string[3]; 
        ch:char; 
        f:boolean; 
    begin
      for ch:='a' to 'z' do
        a[ch]:=' '; 
      a['a']:='a'; 
      readln(n); 
      for i:=1 to n do
        begin
          readln(st); 
          a[st[1]]:=a[st[3]]; 
        end; 
      f:=false; 
      for ch:='a' to 'z' do
       if a[ch]='a' then
         begin write(ch); f:=true; end; 
      if f then writeln
      else writeln('none'); 
    end. 
    
    
    • 1

    Information

    ID
    800
    Time
    1000ms
    Memory
    32MiB
    Difficulty
    10
    Tags
    # Submissions
    8
    Accepted
    0
    Uploaded By