Var x, i,k, s, x2:Integer ;
A:array [1..10]of Integer ;
Begin
Write(' x=') ;read(x) ;writeln;
K:=0;x2:=x;s:=0;
While x>0 do begin
K:=k+1;
X:=x div 10;
End;
For i:=1 to k do begin
A[i]:=x2 mod 10;
X2:=x2 div 10;
S:=s+sqr(a[i]);
Write(' s=', s) ;
End.
Var x, i,k, s, x2:Integer ;
A:array [1..10]of Integer ;
Begin
Write(' x=') ;read(x) ;writeln;
K:=0;x2:=x;s:=0;
While x>0 do begin
K:=k+1;
X:=x div 10;
End;
For i:=1 to k do begin
A[i]:=x2 mod 10;
X2:=x2 div 10;
S:=s+sqr(a[i]);
End;
Write(' s=', s) ;
End.