Pagini recente » Cod sursa (job #1633273) | Rating Ciocirlan Daniel (ciocirlandaniel) | Cod sursa (job #1606502) | Cod sursa (job #1390029) | Cod sursa (job #137983)
Cod sursa(job #137983)
program cifre;
var f,g:text;
s,p,i,t,n,j:word;
begin
assign(f,'cifre.in');
assign(g,'cifre.out');
reset(f);
rewrite(g);
read(f,t);
s:=0;
p:=1;
for i:=1 to t do
begin
read(f,n);
for j:=1 to n do
begin
case (j mod 4) of
0:p:=(j*j)*(j*j);
1:p:=j;
2:p:=(j*j);
3:p:=(j*j)*j;
end;
s:=(s+p)mod 10;
end;
writeln(g,s);
end;
close(f);
close(g);
end.