free pascal的noip2008火柴棒问题求解答
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/17 21:27:07
free pascal的noip2008火柴棒问题求解答
program wu;
var
a,b,c,i,x:integer;
o:array[0..999]of integer;
begin
b:=0;
readln(a);
a:=a-4;
o[0]:=6;
o[1]:=2;
o[2]:=5;
o[3]:=5;
o[4]:=4;
o[5]:=5;
o[6]:=6;
o[7]:=3;
o[8]:=7;
o[9]:=6;
for i:=10 to 99 do
o[i]:=o[i div 10]+o[i mod 10];
for i:=100 to 800 do
o[i]:=o[i div 100]+o[i mod 10]+o[i mod (i div 10)];
for i:=0 to 999 do
for x:=0 to 999 do
begin
c:=i+x;
if (c
program wu;
var
a,b,c,i,x:integer;
o:array[0..999]of integer;
begin
b:=0;
readln(a);
a:=a-4;
o[0]:=6;
o[1]:=2;
o[2]:=5;
o[3]:=5;
o[4]:=4;
o[5]:=5;
o[6]:=6;
o[7]:=3;
o[8]:=7;
o[9]:=6;
for i:=10 to 99 do
o[i]:=o[i div 10]+o[i mod 10];
for i:=100 to 800 do
o[i]:=o[i div 100]+o[i mod 10]+o[i mod (i div 10)];
for i:=0 to 999 do
for x:=0 to 999 do
begin
c:=i+x;
if (c
[i mod (i div 10)] 错了