C3:
uses crt;
var n:integer;
begin
clrscr;
write('nhap so n:');readln(n);
while n>86 do n:=n mod 100;
if (n=68) or (n=86) then write('n la so dep');
readln;
end.
C4:
uses crt;
var n,i,s,c,max,min,j,tam:integer;
a:array[1..100]of integer;
begin
clrscr;
write('nhap so ptu:');readln(n);
for i:=1 to n do
begin
write('A[',i,']=');
readln(a[i]);
if (a[i] mod 3=0) and (a[i] mod 5=0) then c:=c+1;
s:=s+a[i];
end;
writeln('trung binh cong:',s/n:2:4);
max:=a[1];min:=a[1];
for i:=1 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writelN('so lon nhat la:',max);
writeln('so be nhat la:',min);
for i:=1 to n do
for j:=i+1 to n do
if a[i] >a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[i]:=tam;
end;
write('sap xep theo chieu tang dan:');
for i:=1 to n do write(a[i]:3);
writeln;
write('sap xep mang theo chieu dan dan:');
for i:=n downto 1 do write(a[i]:3);
readln;
end.
(mong dc 5*hay nhất)
câu 3:
uses crt;
var n:integer;
begin
clrscr;
write('nhap so n:');readln(n);
if(n mod 100=68) or( n mod 100=86) then write('YES') else write('NO');
readln;
end.
câu 4:
uses crt;
var i,j,n,s,s2,max,min,tam:integer;
a:array[1..100] of integer;
begin
clrscr;
write('nhap so ptu:');readln(n);
for i:=1 to n do
begin
write('A[',i,']=');
readln(a[i]);
s:=s+a[i];
if(a[i] mod 3=0) and(a[i] mod 5=0) then s2:=s2+a[i];
end;
writeln('trung binh cong cua mang la:',s/n:4:2);
max:=a[1];
min:=a[1];
for i:=2 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('so lon nhat la:',max);
writeln('so nho nhat la:',min);
writeln('tong cac so chia het cho 3 va 5 la:',s2);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
write('mang sau khi sap xep tang dan:');
for i:=1 to n do write(a[i],' ');
writeln;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]<a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
write('mang sau khi sap xep giam dan la:');
for i:=1 to n do 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 :))Xem thêm tại https://loigiaisgk.com/cau-hoi or https://giaibtsgk.com/cau-hoi
Copyright © 2021 HOCTAPSGK