fork download
  1. program ct;
  2. const
  3. fi='baitho.inp';
  4. fo='baitho.out';
  5. var i :integer;
  6. f1,f2 :text;
  7. s :string;
  8. procedure doc;
  9. var tam:string;
  10. begin
  11. assign(f1,fi);
  12. reset(f1);
  13. s:='';
  14. while not eof(f1) do
  15. begin
  16. readln(f1,tam);
  17. s:=s+' '+tam;
  18. end;
  19. close(f1);
  20. end;
  21. procedure xuli;
  22. var a :array[1..100]of string;
  23. tam :string;
  24. sl :longint;
  25. kt :boolean;
  26. begin
  27. assign(f2,fo);
  28. rewrite(f2);
  29. while s[1]=#32 do delete(s,1,1);
  30. while s[length(s)]=#32 do delete(s,length(s),1);
  31. while pos(#32#32,s)<>0 do delete(s,pos(#32#32,s),1);
  32. s:=s+#32;
  33. sl:=0;
  34. while pos(#32,s)<>0 do
  35. begin
  36. inc(sl);
  37. a[sl]:=copy(s,1,pos(#32,s)-1);
  38. delete(s,1,pos(#32,s));
  39. end;
  40. kt:=true;
  41. for i:=1 to sl do
  42. if a[i]<>a[sl-i+1] then
  43. begin
  44. kt:=false;
  45. writeln(f2,0);
  46. break;
  47. end;
  48. if kt then
  49. writeln(f2,1);
  50. close(f2);
  51. end;
  52. begin
  53. doc;
  54. xuli;
  55. end.
Runtime error #stdin #stdout 0s 280KB
stdin
Standard input is empty
stdout
Runtime error 2 at $080480CD
  $080480CD
  $080483BA