Bài 1:
uses crt;
var n,i,dem:integer;
begin
clrscr;
write('Nhap n='); readln(n);
if n>1 then
begin
dem:=0;
for i:=1 to n do
if n mod i=0 then inc(dem);
if dem>2 then writeln(n,' la hop so')
else writeln(n,' khong la hop so');
end
else writeln(n,' khong la hop so');
readln;
end.
Bài 2:
uses crt;
var a:array[1..100]of integer;
n,i,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('Trung binh cong cac so da nhap la: ',t/n:4:2);
readln;
end.
Bài 3:
uses crt;
var x:array[1..100]of integer;
n,i,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('X[',i,']='); readln(x[i]);
end;
t:=0;
for i:=1 to n do
if x[i] mod 3=0 then t:=t+x[i];
writeln('Tong cac so chia het cho 3 la: ',t);
readln;
end.
uses crt;
var n:longword;
function nt(n:qword):boolean;
var i:qword;
begin
if n<2 then exit(false);
if n<4 then exit(true);
if n mod 2=0 then exit(false);
if n mod 3=0 then exit(false);
i:=5;
while i*i<=n do
begin
if n mod i=0 then exit(false);
if n mod (i+2)=0 then exit(false);
inc(i,6);
end;
exit(true);
end;
begin
clrscr;
readln(n);
writeln(not(nt(n)));
readkey;
end.
============================
uses crt;
var n,t,i,a:longword;
begin
clrscr;
readln(n);
for i:=1 to n do
begin
read(a);
t:=t+a;
end;
writeln(t/n:0:3);
readkey;
end.
===============================
uses crt;
var n,t,i,a,d:longword;
begin
clrscr;
readln(n);
for i:=1 to n do
begin
read(a);
if a mod 3=0 then
begin
t:=t+a;
inc(d);
end;
end;
if d=0 then writeln(d)
else writeln(t/d:0:3);
readkey;
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