Program S1;
Var
i : integer;
//*******************************
Function kapecar(n:longint) : boolean;
Var
l1,l,i,e : integer;
x,c1,c2 : longint;
cc,c,ch,ch1 : string;
Begin
x := sqr(n);
str(x,ch1);
str(n,ch);
l := length(ch);
l1 := length(ch1);
c := '';
For i:=l1 Downto l1-l+1 Do
c := ch1[i]+c;
val(c,c1,e);
cc := '';
For i:=1 To l1-l Do
cc := cc+ch1[i];
val(cc,c2,e);
If (c1+c2=n) Then
kapecar := true
Else kapecar := false;
End;
//*******************************
Begin
For i:=1 To 1000 Do
If (kapecar(i)) Then
writeln(i);
End.
Inscription à :
Publier les commentaires (Atom)