Advertisement
Guest User

Thiên An

a guest
Apr 26th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.61 KB | None | 0 0
  1. const
  2. nhap='b1.inp';
  3. xuat='b1.out';
  4. var a,b,c,d,e,f,m,l,i,dem:longint;
  5. x:array[1..1000] of longint;
  6. n,s:longint; st:ansistring;
  7. begin
  8. assign(input,nhap); reset(input);
  9. assign(output,xuat); rewrite(output);
  10. readln(n); s:=0; l:=0;
  11. while n<>0 do
  12. begin
  13. m:=n mod 10;
  14. n:=n div 10;
  15. if (m=0) or (m=6) or (m=9) then begin a:=6; s:=s+a; end;
  16. if m=1 then begin b:=2; s:=s+b; end;
  17. if (m=2) or (m=3) or (m=5) then begin c:=5; s:=s+c; end;
  18. if m=4 then begin d:=4; s:=s+d; end;
  19. if m=7 then begin e:=3; s:=s+e; end;
  20. if m=8 then begin f:=7; s:=s+f; end;
  21. end;
  22. writeln('Cau a) : ',s);
  23. end.
  24. close(input);close(ouput);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement