HW31.PAS 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Uses Crt;
  2. Var
  3. i,j,a : shortint;
  4. Procedure DrawTable(x:integer);
  5. var y:integer;
  6. begin
  7. GotoXY(28,1);
  8. Write('’ ¡«¨æ  㬭®¦¥­¨ï ¤® ',x);
  9. for y := 39-x*2 to x*4 + (40-x*2) do
  10. begin
  11. GotoXY(y, 14 - x div 2);
  12. Write('Í');
  13. GotoXY(y, (15 - x div 2) + x);
  14. Write('Í');
  15. end;
  16. Write('¼');
  17. GotoXY(WhereX - 1, WhereY - x - 1);
  18. Write('»');
  19. For y := 1 to x do
  20. begin
  21. GotoXY((37-x*2) + y*4, 13 - x div 2 );
  22. Write(y)
  23. end;
  24. For y := 1 to x do
  25. begin
  26. GotoXY((36-x*2), (14 - x div 2) + y);
  27. if y < 10 then Write(y,' º')
  28. else
  29. Write (y,' º');
  30. GotoXY(WhereX-1, WhereY + 1);
  31. Write('È');
  32. GotoXY((41-x*2)+ x*4 , (14 - x div 2) + y);
  33. Write ('º')
  34. end;
  35. GotoXY(39-x*2, 14 - x div 2);
  36. Write('É');
  37. end; {DrawTable}
  38. Begin
  39. clrscr;
  40. Write('‚¢¥¤¨â¥ ç¨á«® ­  ª®â®à®¥ ¬­®¦¨âì, ¬¥­ì襥 18 ');
  41. Read(a);
  42. While a > 17 do
  43. begin
  44. Writeln('ˆ§¢¨­¨â¥, ¢ë ¬®¦¥â¥ ¢¢¥á⨠⮫쪮 ç¨á«®, ¬¥­ì襥 18 ');
  45. Read(a)
  46. end;
  47. clrscr;
  48. DrawTable(a);
  49. For i := 1 to a do
  50. begin
  51. for j := 1 to a do
  52. begin
  53. GotoXY((37-a*2) + j*4 , (14 - a div 2) + i);
  54. Write(I*J)
  55. end;
  56. end;
  57. Readln;
  58. Readln
  59. End.