Cod sursa(job #811568)

Utilizator VictorVrabieVrabie Victor VictorVrabie Data 12 noiembrie 2012 17:43:44
Problema Cifra Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.32 kb
program cifra;
var a,n,i,b,T,m:longint;
 f1,f2:text;
begin
assign(f1,'cifra.in');
assign(f2,'cifra.out');
reset(f1); rewrite(f2);
readln(f1,T);
b:=0;
m:=0;
i:=0;
while m<T do
begin
readln(f1,n);
m:=m+1;
while i<n do
begin
i:=i+1;
a:=i*i;
b:=b+a;
end;
writeln(f2,b mod 10);
end;
close(f1);
close(f2);
end.