Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
var i,n,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do t:=t+i;
writeln(t);
readln;
end.
program TICHSO;
var
n, i, j, maxVal, a_i, a_j: Integer;
begin
maxVal := 0;
Readln(n);
for i := 1 to n do
begin
Read(a_i);
if Abs(a_i) > maxVal then
maxVal := Abs(a_i);
end;
for i := 1 to n-1 do
begin
for j := i+1 to n do
begin
a_i := Abs(a[i]);
a_j := Abs(a[j]);
if (a_i * a_j) > maxVal then
maxVal := a_i * a_j;
end;
end;
Writeln(maxVal);
end.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Tong cac so la: ',t);
readln;
end.
program XuatSoChan;
uses crt;
const
Max_N = 20;
type
MangSoNguyen = array [1..Max_N] of integer;
var
A: MangSoNguyen;
i, n: integer;
begin
clrscr;
write('Nhap so luong phan tu cua mang: ');
readln(n);
writeln('Nhap cac phan tu vao mang:');
for i := 1 to n do
begin
write('A[', i, ']: ');
readln(A[i]);
end;
writeln('Cac so chan trong mang la:');
for i := 1 to n do
begin
if A[i] mod 2 = 0 then
writeln(A[i]);
end;
readln;
end.
uses crt;
var e,f,i,a,b,c,d: byte;
begin
clrscr;
write('Tu so = '); readln(e);
write('Mau so = '); readln(f);
a:=e;
b:=f;
writeln('Phan so ban dau: ',e,'/',f);
while E <> F do
if E > F then E:=E-F
else F:=F-E;
If e <> 1 then
begin
a:=a div e;
b:=b div e;
write('Phan so toi gian: ',a,'/',b);
end
else write('Phan so da toi gian, ',a,'/',b);
readln
end.