- 火柴棒等式
- 2010-04-11 09:08:43 @
const a:array[0..9]of integer=(6,2,5,5,4,5,6,3,7,6);
var temp,i,j,n,kk:longint;
function ss(k:longint):longint;
var ss1,c:longint;
begin
ss:=0;
ss1:=0;
repeat
c:=k mod 10;
k:=k div 10;
ss1:=ss1+a[c];
until k=0;
ss:=ss1;
end;
begin
readln(n);
temp:=0;
kk:=0;
for i:=0 to n do begin
for j:=0 to n do begin
kk:=i+j;
if ss(i)+ss(j)+ss(kk)=n then begin
inc(temp);
end;
end;
end;
write(temp);
end.
0 条评论
目前还没有评论...