Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- nhap='b1.inp';
- xuat='b1.out';
- var a,b,c,d,e,f,m,l,i,dem:longint;
- x:array[1..1000] of longint;
- n,s:longint; st:ansistring;
- begin
- assign(input,nhap); reset(input);
- assign(output,xuat); rewrite(output);
- readln(n); s:=0; l:=0;
- while n<>0 do
- begin
- m:=n mod 10;
- n:=n div 10;
- if (m=0) or (m=6) or (m=9) then begin a:=6; s:=s+a; end;
- if m=1 then begin b:=2; s:=s+b; end;
- if (m=2) or (m=3) or (m=5) then begin c:=5; s:=s+c; end;
- if m=4 then begin d:=4; s:=s+d; end;
- if m=7 then begin e:=3; s:=s+e; end;
- if m=8 then begin f:=7; s:=s+f; end;
- end;
- writeln('Cau a) : ',s);
- end.
- close(input);close(ouput);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement