

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
uses crt, math;
var N, x, S, i, K : longint;
begin
clrscr;
write('Nhap so N = '); readln(N);
x := 1; K := N;
while N >= 10 do
begin
N := N div 10;
x := x + 1;
end;
N := K; S := 0;
while N > 0 do
begin
i := N mod 10;
S := S + i ** x;
N := N div 10;
end;
if K = S then write(K, ' la so tu man')
else write(K, ' khong la so tu man');
readln
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
uses math;
var n, p, k, s: longint;
begin
readln(n);
p := n;
k := 1;
while p >= 10 do begin
k := k + 1;
p := p div 10;
end;
p := n; s := 0;
while p > 0 do begin
s := s + (p mod 10) ** k;
p := p div 10;
end;
if s = n then write('YES') else write('NO');
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin