Pagini recente » Cod sursa (job #316711) | Cod sursa (job #3041955) | Cod sursa (job #1826173) | Cod sursa (job #369369) | Cod sursa (job #289489)
Cod sursa(job #289489)
program suma;
const fin = 'cifra.in';
fout = 'cifra.out';
a1:array [0..9] of byte = (0,1,5,2,8,3,9,2,8,7);
a2:array [0..9] of byte = (0,1,7,0,6,1,7,4,8,7);
var aux,t:integer;
a:int64;
begin
assign(input,fin);
assign(output,fout);
reset(input);
rewrite(output);
readln(t);
while not eof() do
begin
while not seekeoln() do
read(a);
readln;
aux:=(a div 10) mod 10;
t:= 7*aux mod 10;
if aux mod 2 = 0 then
inc(t,a1[a mod 10])
else
inc(t,a2[a mod 10]);
writeln(t mod 10);
end;
close(input);
close(output);
end.