Câu 1:
program an_danh;
uses crt;
var tong,n,i: integer;
begin
clrscr;
tong:= 0;
write('Nhap n: ');readln(n);
for i:= 1 to n do tong:= tong + i;
write('Tong tu 1 den ',n,' = ',tong);
readln
end.
Câu 2:
program an_danh;
uses crt;
var tong,i: integer;
begin
clrscr;
tong:= 0;
for i:= 1 to 200 do
tong:= tong + i;
write('Tong 200 so nguyen dau tien: ',tong);
readln
end.
Câu 3:
program an_danh;
uses crt;
var tich:real;
i:integer;
begin
clrscr;
tich:= 1;
for i:= 1 to 30 do
tich:= tich * i;
write('Tich 30 so nguyen dau tien: ',tich:0:0);
readln
end.
Câu 4:
program an_danh;
uses crt;
var gt:real;
i,n: integer;
begin
clrscr;
write('Nhap n: ');readln(n);
gt:= 1;
for i:= 1 to n do gt:= gt * i;
write(n,'! = ',gt:0:0);
readln
end.
Câu 5:
program an_danh;
uses crt;
var x,n,i:integer;
kq:real;
begin
clrscr;
write('Nhap x: ');readln(x);
write('Nhap n: ');readln(n);
kq:= x;
for i:= 2 to n do kq:= kq * x;
write(x,' mu ',n,' = ',kq:0:0);
readln
end.
Câu 1:
uses crt;
var n,i,s:longint;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+i;
writeln('tong S=',s);
readln;
end.
Câu 2:
uses crt;
var i,s:longint;
begin
clrscr;
s:=0;
for i:=1 to 200 do
s:=s+i;
writeln('tong 200 so nguyen dau tien la: ',s);
readln;
end.
Câu 3:
uses crt;
var i:integer;
s:real;
begin
clrscr;
s:=1;
for i:=1 to 30 do
s:=s*i;
writeln(s:4:0);
readln;
end.
Câu 4:
uses crt;
var n:qword;
i:integer;
s:real;
begin
clrscr;
write('n='); readln(n);
s:=1;
for i:=1 to n do
s:=s*i;
writeln(n,'!=',s:4:0);
readln;
end.
Câu 5:
uses crt;
var n,x,i:longint;
lt:real;
begin
clrscr;
write('co so x='); readln(x);
write('so mu n='); readln(n);
if n>=0 then
begin
lt:=1;
for i:=1 to n do
lt:=lt*x;
writeln(x,'^',n,'=',lt:4:0);
end
else writeln('vui long nhap lai so mu khong am');
readln;
end.
Nguyễn Lê Phước Thịnh Hakita Nguyen Nguyễn Minh Lệ duong nguyenvan Luân Trần Tran Ngoc Long các bạn giúp mình vs...!!!