program tim_tuoi;
uses crt;
var i,j,ngaysinh,tuoi, uoctuoi,k:integer;
begin
clrscr;
for i:=1 to 9 do
for j:=0 to 9 do
for k:=0 to 9 do
begin
uoctuoi:=sqr(i)+sqr(j)+sqr(k);
tuoi:=i*100+j*10+k;for ngaysinh:=1 to 31 do
if tuoi =uoctuoi+ngaysinh then write('tuoi cua cu la: ',tuoi);
end;
readln;
end.