Pagini recente » Cod sursa (job #316779) | Cod sursa (job #2965548) | Cod sursa (job #1802248) | Cod sursa (job #2593270) | Cod sursa (job #27600)
Cod sursa(job #27600)
const r:array[0..19] of byte=(0,1,5,2,8,3,9,2,8,7,7,8,4,7,3,8,4,1,5,4);
var n:string;
nr,err:byte;
t,i:integer;
begin
assign(input, 'cifra.in'); reset(input);
assign(output,'cifra.out'); rewrite(output);
readln(t);
for i:=1 to t do begin
readln(n);
if length(n)>2 then delete(n,1,length(n)-2);
val(n,nr,err);
writeln((4*(nr div 20)+r[nr mod 20])mod 10);
end;
close(input); close(output);
end.