Pagini recente » Cod sursa (job #1368131) | Cod sursa (job #155573) | Cod sursa (job #2789485) | Cod sursa (job #2988715) | Cod sursa (job #16953)
Cod sursa(job #16953)
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.