Bài 80:
program chinh_phuong;
uses crt;
var n,i,a,max:longint;
begin
clrscr;
write('Nhap n: '); readln(n);
max:=0;
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a);
if (sqr(trunc(sqrt(a)))=a) and (a>max) then max:=a;
end;
if max=0 then write('Khong co so chinh phuong')
else write('So chinh phuong lon nhat la ',max);
readln;
end.
Bài 81:
program chuso;
uses crt;
var n,i,a,b,max,ptu,d:longint;
begin
clrscr;
write('Nhap n: '); readln(n);
max:=0; ptu:=0;
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a);
if a=0 then d:=1;
b:=a; d:=0;
while b>0 do
begin
d:=d+1;
b:=b div 10;
end;
if (d>=max) then
begin
max:=d;
ptu:=a;
end;
end;
write('Phan tu co nhieu chu so nhat la: ',ptu);
readln;
end.
Bài 82:
program tong_max;
uses crt;
var n,i,a,b,t,max,ptu:longint;
begin
clrscr;
write('Nhap n: '); readln(n);
max:=0; ptu:=0;
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a);
b:=a; t:=0;
while b>0 do
begin
t:=t+b mod 10;
b:=b div 10;
end;
if (t>max) then
begin
ptu:=a;
max:=t;
end;
if (t=max) and (a>ptu) then
begin
ptu:=a;
max:=t;
end;
end;
write('So co tong chu so lon nhat la: ',ptu);
readln;
end.
80
var so,max,k,i,n:longint;
begin
writeln('nhap so so nguyen duong can kiem tra');readln(n);
writeln('nhap lan luot cac so nguyen duong can kiem tra');
max:=0;
for i:=1 to n do begin
readln(so);
k:=trunc(sqrt(so));
if (k*k=so)and(so>max) then max:=so;
end;
writeln('so can tim la:',max);
readln;
end.
81
var n,i,so1,so2,d,m,so3:longint;
begin
writeln('nhap so nguyen duong n);readln(n);
writeln('nhap lan luot n so nguyen duong');m:=0;
for i:=1 to n do begin
readln(so1);
d:=1;so2:=so1;
while so>0 do begin
so2:=so2 div 10;
d:=d+1;
end;
if d>=m then begin so3:=so1;m:=d;end;
end;
write('so can tim la:',so3);
readln;
end.
82
var n,i,so1,so2,d,m,so3:longint;
begin
writeln('nhap so nguyen duong n);readln(n);
writeln('nhap lan luot n so nguyen duong');m:=0;so3:=0;
for i:=1 to n do begin
readln(so1);
d:=0;so2:=so1;
while so>0 do begin
d:=d+(so2 mod 10);
so2:=so2 div 10;
end;
if d>m then begin so3:=so1m:=d; end
else if (d=m)and(so3<so1) then so3:=so1;
end;
write('so can tim la:',so3);
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