tintstr.pp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. program tintstr;
  2. {$ifdef cpujvm}
  3. uses
  4. jdk15;
  5. {$macro on}
  6. {$define writeln:=jlsystem.fout.println}
  7. {$define write:=jlsystem.fout.println}
  8. {$endif}
  9. var
  10. l: longint;
  11. c: cardinal;
  12. i: int64;
  13. q: qword;
  14. type
  15. tr1 = packed record
  16. s: string[1];
  17. b1,b2,b3,b4: byte;
  18. end;
  19. procedure ts1(const res1, res2, res3, res4: string);
  20. var
  21. r: tr1;
  22. begin
  23. with r do
  24. begin
  25. b1:=0;
  26. b2:=0;
  27. b3:=0;
  28. b4:=0;
  29. str(l,s);
  30. if (res1<>s) or
  31. (b1<>0) or
  32. (b2<>0) or
  33. (b3<>0) or
  34. (b4<>0) then
  35. halt(1);
  36. str(c,s);
  37. if (res2<>s) or
  38. (b1<>0) or
  39. (b2<>0) or
  40. (b3<>0) or
  41. (b4<>0) then
  42. halt(2);
  43. str(i,s);
  44. if (res3<>s) or
  45. (b1<>0) or
  46. (b2<>0) or
  47. (b3<>0) or
  48. (b4<>0) then
  49. halt(3);
  50. str(q,s);
  51. if (res4<>s) or
  52. (b1<>0) or
  53. (b2<>0) or
  54. (b3<>0) or
  55. (b4<>0) then
  56. halt(4);
  57. end;
  58. end;
  59. type
  60. tr2 = packed record
  61. s: string[3];
  62. b1,b2,b3,b4: byte;
  63. end;
  64. procedure ts3(const res1, res2, res3, res4: string);
  65. var
  66. r: tr2;
  67. begin
  68. with r do
  69. begin
  70. b1:=0;
  71. b2:=0;
  72. b3:=0;
  73. b4:=0;
  74. str(l,s);
  75. if (res1<>s) or
  76. (b1<>0) or
  77. (b2<>0) or
  78. (b3<>0) or
  79. (b4<>0) then
  80. halt(1);
  81. str(c,s);
  82. if (res2<>s) or
  83. (b1<>0) or
  84. (b2<>0) or
  85. (b3<>0) or
  86. (b4<>0) then
  87. halt(2);
  88. str(i,s);
  89. if (res3<>s) or
  90. (b1<>0) or
  91. (b2<>0) or
  92. (b3<>0) or
  93. (b4<>0) then
  94. halt(3);
  95. str(q,s);
  96. if (res4<>s) or
  97. (b1<>0) or
  98. (b2<>0) or
  99. (b3<>0) or
  100. (b4<>0) then
  101. halt(4);
  102. end;
  103. end;
  104. var
  105. a: ansistring;
  106. u: unicodestring;
  107. xl: longint;
  108. begin
  109. l:=high(longint);
  110. c:=high(cardinal);
  111. i:=high(int64);
  112. q:=high(qword);
  113. ts1('2','4','9','1');
  114. ts3('214','429','922','184');
  115. l:=low(longint)+1;
  116. c:=high(cardinal)-1;
  117. i:=low(int64)+1;
  118. q:=high(qword)-1;
  119. ts1('-','4','-','1');
  120. ts3('-21','429','-92','184');
  121. (*
  122. str(1,a);
  123. str(2,u);
  124. *)
  125. end.