Pagini recente » Cod sursa (job #148835) | Cod sursa (job #494849) | Cod sursa (job #1416640) | Cod sursa (job #1585876) | Cod sursa (job #2002121)
var a,b:qword;
i,j,m,n:longint;
s:string;
begin
assign(input,'cifra.in');
reset(input);
readln(s);
close(input);
if length(s)>2 then s:=s[length(s)-1]+s[length(s)];
val(s,n,m);
assign(output,'cifra.out');
rewrite(output);
{for n:=1 to 150 do
begin
a:=0;}
for i:=1 to n do
begin
b:=1;
for j:=1 to i do
begin b:=b*i; b:=b mod 1000; end;
a:=a+b;
a:=a mod 10;
end;
writeln(a mod 10);
{end;}
close(output);
end.