tintstr.pp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. var
  2. l: longint;
  3. c: cardinal;
  4. i: int64;
  5. q: qword;
  6. procedure ts1(const res1, res2, res3, res4: string);
  7. var
  8. r: packed record
  9. s: string[1];
  10. b1,b2,b3,b4: byte;
  11. end;
  12. begin
  13. with r do
  14. begin
  15. b1:=0;
  16. b2:=0;
  17. b3:=0;
  18. b4:=0;
  19. str(l,s);
  20. if (res1<>s) or
  21. (b1<>0) or
  22. (b2<>0) or
  23. (b3<>0) or
  24. (b4<>0) then
  25. halt(1);
  26. str(c,s);
  27. if (res2<>s) or
  28. (b1<>0) or
  29. (b2<>0) or
  30. (b3<>0) or
  31. (b4<>0) then
  32. halt(2);
  33. str(i,s);
  34. if (res3<>s) or
  35. (b1<>0) or
  36. (b2<>0) or
  37. (b3<>0) or
  38. (b4<>0) then
  39. halt(3);
  40. str(q,s);
  41. if (res4<>s) or
  42. (b1<>0) or
  43. (b2<>0) or
  44. (b3<>0) or
  45. (b4<>0) then
  46. halt(4);
  47. end;
  48. end;
  49. procedure ts3(const res1, res2, res3, res4: string);
  50. var
  51. r: packed record
  52. s: string[3];
  53. b1,b2,b3,b4: byte;
  54. end;
  55. begin
  56. with r do
  57. begin
  58. b1:=0;
  59. b2:=0;
  60. b3:=0;
  61. b4:=0;
  62. str(l,s);
  63. if (res1<>s) or
  64. (b1<>0) or
  65. (b2<>0) or
  66. (b3<>0) or
  67. (b4<>0) then
  68. halt(1);
  69. str(c,s);
  70. if (res2<>s) or
  71. (b1<>0) or
  72. (b2<>0) or
  73. (b3<>0) or
  74. (b4<>0) then
  75. halt(2);
  76. str(i,s);
  77. if (res3<>s) or
  78. (b1<>0) or
  79. (b2<>0) or
  80. (b3<>0) or
  81. (b4<>0) then
  82. halt(3);
  83. str(q,s);
  84. if (res4<>s) or
  85. (b1<>0) or
  86. (b2<>0) or
  87. (b3<>0) or
  88. (b4<>0) then
  89. halt(4);
  90. end;
  91. end;
  92. begin
  93. l:=high(longint);
  94. c:=high(cardinal);
  95. i:=high(int64);
  96. q:=high(qword);
  97. ts1('2','4','9','1');
  98. ts3('214','429','922','184');
  99. l:=low(longint)+1;
  100. c:=high(cardinal)-1;
  101. i:=low(int64)+1;
  102. q:=high(qword)-1;
  103. ts1('-','4','-','1');
  104. ts3('-21','429','-92','184');
  105. end.