about summary refs log tree commit diff
path: root/12/TP-ThanhHoá-2009/BAI4.PAS
blob: 87060321568b87b45925f2abd7a56664b7b983e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const
  m: array[1..9] of byte = (0, 0, 1, 1, 0, 0, 4, 7, 0);
  equa: array[1..9] of ansistring = (
    #10,
    #10,
    #10'1+2-3=0'#10,
    #10'1-2-3+4=0'#10,
    #10,
    #10,
    #10'1+2-3+4-5-6+7=0'#10'1+2-3-4+5+6-7=0'#10'1-2+3+4-5+6-7=0'#10'1-2-3-4-5+6+7=0'#10,
    #10'1+2+3+4-5-6-7+8=0'#10'1+2+3-4+5-6+7-8=0'#10'1+2-3+4+5+6-7-8=0'#10'1+2-3-4-5-6+7+8=0'#10'1-2+3-4-5+6-7+8=0'#10'1-2-3+4+5-6-7+8=0'#10'1-2-3+4-5+6+7-8=0'#10,
    #10
  );

var
  n: byte;
  f: text;

begin
  assign(f, 'BAI4.INP');
  reset(f);
  read(f, n);
  close(f);

  assign(f, 'BAI4.OUT');
  rewrite(f);
  write(f, m[n], equa[n]);
  close(f)
end.