Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
May 10, 2015, 4:41 p.m.
FORMAT:
Text only
SIZE:
518 Bytes
Raw
Download
Tweet
HITS:
1029
Go to comments
Report
Tính tổng
S= x^i với i từ 0 đến n;
Tương tự bài tính giai thừa
nhưng hàm Lũy thừa
F(x,i)= x*x*x*x...*x
(i thừa số);
VAR s:LONGINT;
i,x,n:LONGINT;
FUNCTION Luythua(x,i:LONGINT):LONGINT;
VAR s,j:LONGINT;
BEGIN
s:=1;
FOR j:=1 TO i DO
s:=s*x;
Luythua:=s;
END;
BEGIN
Writeln('Nhap n : ');
readln(n);
Write('Nhap x : ');
Readln(x);
s:=0;
FOR i:=0 TO n DO
s:=s+Luythua(x,i);
Write('S= ',s);
readln;
END.
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus