
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.


Bài 1:
Program hotrotinhoc;
var a,b,c,d,max: integer;
begin
write('Nhap a,b,c,d :'); readln(a,b,c,d);
max:=0;
if a>max then max:=a;
if b>max then max:=b;
if c>max then max:=c;
if d>max then max:=d;
write(max);
readln
end.
Bài 2:
Program hotrotinhoc;
var a,b,c : integer;
begin
write('Nhap 3 canh a,b,c'); readln(a,b,c);
if (a+b>c) or (a+c>b) or (b+c>a) then write('Thoa man') else ('Khong thoa man trong tung truong hop tuong ung');
readln
end.
Bài 4: Câu hỏi của Quỳnh Như - Tin học 8 | Học trực tuyến
Bài 5:
Program hotrotinhoc;
var a,n: integer;
t: longint;
begin
Write('Nhap a,n :'); readln(a,n);
t:=1;
for i:=1 to n do
t:=t*a;
write(t);
readln
end.

Lời giải:
program hotrotinhoc;
var a,b : integer;
s: longint;
t: real;
begin
write('A='); readln(a);
write('B='); readln(b);
s:=a;
s:=s+b;
writeln(s);
s:=0;
s:=a;
s:=s-b;
writeln(s);
s:=0;
s:=a;
s:=s*b;
writeln(s);
t:=a;
t:=t/b;
write(t:1:2);
readln
end.

Bài 1:
program pstg;
uses crt;
var a,b,i,u : integer;
f : text;
BEGIN
clrscr;
assign(f,'PSTG.INP');
reset(f);
read(f, a);
read(f, b);
u:=1;
for i:= 1 to a do if ((a mod i)=0) and ((b mod i)=0) and (i>u) then u:=i;
a:= a div u;
b:= b div u;
assign(f,'PSTG.OUT');
rewrite(f);
write(f, a,' ',b);
close(f);
END.
bài 4 dễ ẹt à
uses crt;
const fi='quediem.inp';
fo='quediem.out';
var i,m,n,d,x,j,csc:longint;
a,b:array[1..1000]of integer;
f1,f2:text;
begin
clrscr;
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
{-------------------------tim-so-lon-nhat--------------------------}
write(f2,'so lon nhat la: ');
m:=n;
if m mod 2=0 then
begin
for i:=1 to n div 2 do
write(f2,'1');
end
else begin
write(f2,'7');
for i:=2 to n div 2 do
write(f2,'1');
end;
{----------------------------tim-so-nho-nhat------------------------}
writeln(f2);
a[1]:=2; b[1]:=1;
a[2]:=5; b[2]:=2;
a[3]:=4; b[3]:=4;
a[4]:=6; b[4]:=6;
a[5]:=3; b[5]:=7;
a[6]:=7; b[6]:=8;
d:=(n div 7)+1;
if n mod 7=0 then d:=d-1;
if d=1 then begin
case n of
2:write(f2,'so nho nhat la: ',1);
3:write(f2,'so nho nhat la: ',7);
4:write(f2,'so nho nhat la: ',4);
5:write(f2,'so nho nhat la: ',2);
6:write(f2,'so nho nhat la: ',0);
7:write(f2,'so nho nhat la: ',8);
end;
end;
if d>1 then
begin
write(f2,'so nho nhat la: ');
for i:=1 to d do
if i=1 then begin
b[4]:=6;
for j:=1 to 6 do
begin
x:=n;
x:=x-a[j];
csc:=x div 7+1;
if x mod 7=0 then csc:=csc-1;
if csc=d-i then begin
write(f2,b[j]);
n:=x;
break;
end;
end;
end
else begin
a[1]:=6; b[1]:=0;
a[2]:=2; b[2]:=1;
a[3]:=5; b[3]:=2;
a[4]:=4; b[4]:=4;
a[5]:=3; b[5]:=7;
a[6]:=7; b[6]:=8;
for j:=1 to 6 do
begin
x:=n;
x:=x-a[j];
csc:=(x div 7)+1;
if x mod 7=0 then csc:=csc-1;
if csc=d-i then begin
write(f2,b[j]);
n:=x;
break;
end;
end;
end;
end;
close(f1);
close(f2);
readln;
end.

1:
\n\nuses crt;
\n\nvar a:integer;
\n\nbegin
\n\nclrscr;
\n\nwrite(\'nhap a=\'); readln(a);
\n\nif a mod 2=0 then writeln(a,\' la so chan\')
\n\nelse writeln(a,\' la so le\');
\n\nreadln;
\n\nend.
\n\n2:
\n\nuses crt;
\n\nvar a,b:integer;
\n\nbegin
\n\nclrscr;
\n\nwrite(\'a=\'); readln(a);
\n\nwrite(\'b=\'); readln(b);
\n\nif a>b then writeln(a,\' lon hon \',b)
\n\nelse if a<b then writeln(b,\' lon hon \',a)
\n\nelse writeln(b,\' bang \',a);
\n\nreadln;
\n\nend.
\n
1: tính tổng của \(S=1+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+...+\frac{1}{100^2}\)
uses crt;
var s:real;
i:integer;
begin
clrscr;
s:=0;
for i:=1 to 100 do
s:=s+1/(sqr(i));
writeln('tong cua day so la: ',s);
readln;
end.
2: tính tổng \(S=1+\frac{1}{3^2}+\frac{1}{5^2}+\frac{1}{7^2}+...+\frac{1}{n^2}\)
uses crt;
var s:real;
n,i:integer;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
if i mod 2=1 then s:=s+1/(sqr(i));
writeln('tong cua day so la: ',s:4:2);
readln;
end.
Olm chào em, cảm ơn đánh giá của em về chất lượng bài giảng của Olm, cảm ơn em đã đồng hành cùng Olm trên hành trình tri thức. Chúc em học tập hiệu quả và vui vẻ cùng Olm em nhé!