program baitap;
uses crt;
var a : array[1..100] of integer;
i ,n ,max,min ,s : integer;
function snt(x : integer) : boolean;
var i,d : integer;
begin d:=0;
for i:=1 to x do if x mod i = 0 then d:=d+1;
if d = 2 then snt:=true else snt:=false;
end;
begin clrscr;
write('Nhap so n :'); readln(n);
for i:=1 to n do begin
write('Nhap phan tu thu ',i,' la :');
readln(a[i]); end;
max:=a[1];
for i:=2 to n do if max < a[i] then max:=a[i];
min:=a[1];
for i:=2 to n do if min > a[i] then min:=a[i];
writeln('Gia tri lon nhat la :', max);
Writeln('Gia tri nho nhat la:', min);
writeln('Cac phan tu chia het cho 3 la:');
for i:=1 to n do
If a[i] mod 3 = 0 then write(a[i]:3);
writeln;
writeln('Cac so nguyen to co trong day la :');
for i:=1 to n do if snt(a[i]) = true then write(a[i]:3);
readln;
end.
Program Hotboy;
Uses crt;
Var a:array[1..100] of integer;
Max,min,nt,j:longint;
i,n : byte;
Function snt(m : integer) : boolean;
begin
nt:=0;
For i:=1 to m do
if m mod i = 0 then inc(nt);
if (nt= 2 ) then snt:=true else snt:=false;
end;
Begin
Clrscr;
Write('nhap n ');
Readln(n);
For i:=1 to n do
Begin
Write('A[',i,']');
Readln(A[i]);
End;
Max:=A[1];
Min:= A[1];
For i:= 2 to n do
If (A[i] > max) then Max:= A[i];
If (A[i] < min ) then Min :=A[i];
Writeln('so nho nhat la',min,' so lon nhat la',max);
For i:=1 to n do
If (A[i] mod 3=0) then writeln('so chia het cho 3 la',A[i]:3:2);
For i:=1 to n do
If snt(A[i])= true then write(a[i],' ');
Readln
End.
Tin học, tiếng Anh: informatics, tiếng Pháp: informatique, là một ngành khoa học chuyên nghiên cứu quá trình tự động hóa việc tổ chức, lưu trữ, xử lý và truyền dẫn thông tin của một hệ thống máy tính cụ thể hoặc trừu tượng (ảo). Với cách hiểu hiện nay, tin học bao hàm tất cả các nghiên cứu và kỹ thuật có liên quan đến việc mô phỏng, biến đổi và tái tạo thông tin.
Nguồn : Wikipedia - Bách khoa toàn thưLớp 8 - Năm thứ ba ở cấp trung học cơ sở, học tập bắt đầu nặng dần, sang năm lại là năm cuối cấp áp lực lớn dần nhưng các em vẫn phải chú ý sức khỏe nhé!
Nguồn : ADMIN :))Copyright © 2021 HOCTAP247