BT1:
uses crt;
var n,x:longint;
function snt(x:longint):boolean;
var tam:longint;
begin
if x<2 then snt:=false
else
begin
snt:=true;
for tam:=2 to round(sqrt(x)) do
if x mod tam=0 then exit(false);
end;
end;
BEGIN
clrscr;
write('Nhap n:'); readln(n);
writeln('Cac cap so x,y thoa man la:');
for x:=1 to n div 2 do
if (snt(x)) and (snt(n-x)) then writeln(x,',',n-x);
readln
END.
BT2:
uses crt;
var n,i,vt,d,max,j:byte;
a:array[1..200] of integer;
BEGIN
clrscr;
write('Nhap n:'); readln(n);
for i:=1 to n do
begin
write('Nhap a[',i,']:');
readln(a[i]);
end;
max:=0;
for i:=1 to n do
begin
d:=0;
for j:=1 to n do
if a[i] mod a[j]=0 then inc(d);
if d>max then
begin
max:=d;
vt:=i;
end;
end;
writeln('So hang xuat hien nhieu nhat la ',a[vt]);
write('Vi tri:',vt);
readln
END.
Chúc bn hc tốt!
program capso;
uses crt;
var n,x:integer;
function ktnt(k:integer):boolean;
var l:integer;
begin
ktnt:=false;
if k<2 then exit;
for l:=2 to trunc(sqrt(k)) do
if k mod l=0 then exit;
ktnt:=true;
end;
BEGIN
clrscr;
write('Nhap n: '); readln(n);
writeln('Cap so x,y thoa man la: ');
for x:=2 to n div 2 do
if ktnt(x) and ktnt(n-x) then writeln(x,' ',y);
readln
end.
Bài 2:
program xuathien;
var A:array[1..100] of integer;
n,i,max,j,d,ptu:integer;
begin
clrscr;
write('Nhap so luong phan tu n: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']= '); readln(A[i]);
end;
max:=1; ptu:=A[i];
for i:=1 to n-1 do
begin
d:=0;
for j:=1 to n do
if A[j]=A[i] then d:=d+1;
if d>max then
begin
max:=d;
ptu:=A[i];
end;
end;
writeln(ptu,' la gia tri xuat hien nhieu nhat trong day');
write('Cac vi tri xuat hien cua ',ptu,' la: ');
for i:=1 to n do
if A[i]=ptu then write(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 10 - Năm thứ nhất ở cấp trung học phổ thông, năm đầu tiên nên có nhiều bạn bè mới đến từ những nơi xa hơn vì ngôi trường mới lại mỗi lúc lại xa nhà mình hơn. Được biết bên ngoài kia là một thế giới mới to và nhiều điều thú vị, một trang mới đang chò đợi chúng ta.
Nguồn : ADMIN :))Xem thêm tại https://loigiaisgk.com/cau-hoi or https://giaibtsgk.com/cau-hoi
Copyright © 2021 HOCTAPSGK