fork download
  1. program remix;
  2. const
  3. MAXN = 100000;
  4. var
  5. N,i : longint;
  6. remixx, testo : array[0..MAXN] of char;
  7. spazio:boolean;
  8.  
  9. procedure ripulisci(numchar: longint; var R, T: array of char);
  10. var h,k:longint;
  11. begin
  12. k:=0; h:=0; spazio:=false;
  13. while h<numchar do
  14. if ((R[h]<>'P') or (R[h+1]<>'a') or (R[h+2]<>'H')) and ((R[h]<>'T') or (R[h+1]<>'u') or (R[h+2]<>'N') or (R[h+3]<>'Z')) then begin T[K]:=R[h]; k:=k+1; h:= h+1; end
  15. else
  16. if ((R[h]='P') and (R[h+1]='a') and (R[h+2]='H')) then h:=h+3
  17. else h:=h+4;
  18. if spazio=true then testo[k]:=' ';k:=k+1;
  19.  
  20. end;
  21.  
  22.  
  23.  
  24.  
  25.  
  26. begin
  27. (* assign(input, 'input.txt'); reset(input);
  28.   assign(output, 'output.txt'); rewrite(output);*)
  29. readln(N);
  30. for i:=0 to N-1 do read(remixx[i]);
  31. readln;
  32. ripulisci(N, remixx, testo);
  33. for i:=0 to N-1 do write(testo[i]); writeln;
  34.  
  35. end.
  36.  
  37.  
Success #stdin #stdout 0s 5284KB
stdin
27
TuNZTuNZSettePaHPaHTuNZOtto
stdout
SetteOtto