郭宇辰 2013-09-21 23:43:00
点我顶贴
收藏
删除
const a:array[0..9]of integer=(6,2,5,5,4,5,6,3,7,6);
var i,i1,i2,j,j1,j2,k,k1,k2,n,t,h:longint;
begin
readln(n);
n:=n-4;
t:=0;
for i:=0 to 99 do
for j:=0 to 99 do
for k:=0 to 99 do
if i+j=k then
begin
i1:=i div 10;
i2:=i mod 10;
j1:=j div 10;
j2:=j mod 10;
k1:=k div 10;
k2:=k mod 10;
if i1>0 then h:=h+a[i1];
if j1>0 then h:=h+a[j1];
if k1>0 then h:=h+a[k1];
h:=h+a[i2]+a[j2]+a[k2];
if h=n then t:=t+1;
end;
writeln(t);
end.