
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 x,y:integer;
{-------------------chuong-trinh-con-tong----------------------------}
function tong(a,b:integer):integer;
begin
tong:=a+b;
end;
{-------------------chuong-trinh-con-hieu----------------------------}
funtion hieu(a,b:integer):integer;
begin
hieu:=a-b;
end;
{-------------------chuong-trinh-con-tich----------------------------}
function tich(a,b:integer):integer;
begin
tich:=a*b;
end;
{-------------------chuong-trinh-con-thuong----------------------------}
function thuong(a,b:integer):real;
begin
thuong:=a/b;
end;
{----------------------chuong-trinh-chinh-----------------------}
begin
clrscr;
write('Nhap x='); readln(x);
write('Nhap y='); readln(y);
writeln('Tong la: ',tong(x,y));
writeln('Hieu la: ',hieu(x,y));
writeln('Tich la: ',tich(x,y));
writeln('Thuong la: ',thuong(x,y):4:2);
readln;
end.

var n, i: word;
begin
readln(n);
while (n<>0) do
begin
writeln(n mod 10);
n:=n div 10;
end;
readln
end.

uses crt;
var i,n,c,b,uc:integer;
bcnn:int64;
a:array[1..100] of integer;
{--------------------------chuong-trinh-con-tim-ucln-cua-hai-so---------------}
function ucln(c,b:integer):integer;
var r:integer;
begin
r:=c mod b;
while r<>0 do
begin
c:=b;
b:=r;
r:=c mod b;
end;
ucln:=b;
end;
{---------------------------chuong-trinh-chinh-----------------------------------}
begin
clrscr;
Write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
uc:=ucln(a[1],a[2]);
for i:=3 to n do
uc:=ucln(uc,a[i]);
writeln(uc);
readln;
end.

uses crt;
var a,b,c,nn:integer;
//chuongtrinhcon
function min(var x,y:integer):integer;
begin
if x<y then min:=x
else min:=y;
end;
//chuongtrinhchinh
begin
clrscr;
readln(a,b,c);
nn=min(a,b);
nn=min(nn,c);
writeln(nn);
readln;
end.

Bài 2:
Program HOC24;
var a: array[1..200] of integer;
i,d,n: integer;
begin
write('Nhap so phan tu N: '); readln(N);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:=1 to n do if a[i] mod 3=0 then d:=d+1;
write('Co ',d,' phan tu chia het cho 3');
readln
end.
Bài 3:
Program HOC24;
var a: array[1..30] of integer;
i,d,n: integer;
begin
write('Nhap so phan tu N: '); readln(N);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
d:=1;
for i:=1 to n do if a[i] mod 2=0 then d:=d*a[i];
write(Tich cac phan tu chia het cho 2 la: ',d);
readln
end.

uses crt;
var a,b:integer;
{-------------chuong-trinh-con-tinh-tong---------------------}
function tong(x,y:integer):integer;
begin
tong:=x+y;
end;
{-------------chuong-trinh-con-tinh-tich------------------}
function tich(x,y:integer):integer;
begin
tich:=x*y;
end;
{-----------------chuong-trinh-con-so-lon------------------}
function solon(x,y:integer):integer;
begin
if x>y then solon:=x
else solon:=y;
end;
{-----------------chuong-trinh-con-so-be------------------}
function sobe(x,y:integer):integer;
begin
if x<y then sobe:=x
else sobe:=y;
end;
{--------------------chuong-trinh-chinh-----------------}
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
writeln('Tong la: ',tong(a,b));
writeln('Tich la: ',tich(a,b));
writeln('So lon la: ',solon(a,b));
writeln('So be la: ',sobe(a,b));
readln;
end.
uses crt; var x:integer; begin clrscr; x:=0; while x*x*x<=3000 do begin write(x:4); x:=x+1; end; readln; end.