Câu 1.Tìm giá trị nhỏ nhất trong một dãy số a1,a2…aN
Câu2: giải phương trình bậc nhất bx+c=0(b khác 0)
Câu 1.Tìm giá trị nhỏ nhất trong một dãy số a1,a2…aN Câu2: giải phương trình bậc nhất bx+c=0(b khác 0)
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Hãy giúp đỡ người khác giải quyết rắc rối, và rắc rối của bạn sẽ biến mất.
Câu 1:
program GIATRINHONHAT;
uses crt;
var n,i,min:integer;
a:array[1..1000] of integer;
begin
clrscr;
i:=0;
write(‘Nhap n: ‘); readln(n);
write(‘Nhap so thu 1: ‘); readln(a[1]);
min:=a[1];
for i:=2 to n do
begin
write(‘Nhap so thu ‘,i,’: ‘); readln(a[i]);
if min>a[i] then min:=a[i];
end;
writeln(‘Gia tri nho nhat la: ‘,min);
readln;
end.
Câu 2:
program GIAIPHUONGTRINHBACNHAT;
uses crt;
var a,b:real;
begin
clrscr;
write(‘Nhap he so a: ‘); readln(a);
write(‘Nhap he so b: ‘); readln(b);
if a=0 then writeln(‘Khong hop le (a khac 0). Nhap lai!!!’)
else writeln(‘Phuong trinh co nghiem duy nhat: x=’,-b/a:2:4);
readln;
end.