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.
câu 1
uses crt;
var a,b,c,kt,kt1:integer;
tbc1,tbc2,tbc3:real;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
{-------------------------------cau-a----------------------}
if (a>b) and (a>c) then
begin
write(a,' ');
if b>c then write(b,' ',c);
if b<c then write(c,' ',b);
end;
if (b>a) and (b>c) then
begin
write(b,' ');
if a>c then write(a,' ',c);
if a<c then write(c,' ',a);
end;
if (c>a) and (c>b) then
begin
write(c,' ');
if a>b then write(a,' ',b);
if a<b then write(b,' ',a);
end;
{--------------------------cau-b-------------------------}
writeln;
kt:=0;
tbc1:=(a+b)/2;
tbc2:=(b+c)/2;
tbc3:=(c+a)/2;
if tbc1=c then
begin
kt:=1;
writeln(c);
end;
if tbc2=a then
begin
kt:=1;
writeln(a);
end;
if tbc3=b then
begin
kt:=1;
writeln(b);
end;
if kt=0 then writeln('NO');
{--------------------cau-c-------------------------------}
writeln;
if (a+b>c) and (a+c>b) and (b+c>a) then
begin
kt1:=0;
if sqr(c)=sqr(a)+sqr(b) then
begin
kt1:=1;
writeln(c);
end;
if sqr(a)=sqr(b)+sqr(c) then
begin
kt1:=1;
writeln(a);
end;
if sqr(b)=sqr(a)+sqr(c) then
begin
kt1:=1;
writeln(b);
end;
if kt1=0 then writeln('NO');
end
else writeln('day khong phai la 3 canh trong 1 tam giac');
readln;
end.
uses crt;
var i,n,t,dem:integer;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
dem:=0;
for i:=1 to n do
if i mod 2=0 then
begin
t:=t+i;
inc(dem);
end;
writeln('Trung binh cac so chan trong khoang tu 1 toi ',n,' la: ',t/dem:4:2);
readln;
end.
uses crt;
var n,i,t,kt,j,t1,d,x,y:integer;
st:string;
begin
clrscr;
repeat
write('nhap n='); readln(n);
until n>0;
writeln('Cac so le trong khoang tu 1 toi ',n,' la: ');
for i:=1 to n do
if i mod 2=1 then write(i:4);
writeln;
writeln('Cac so chan trong khoang tu 2 toi ',n,' la: ');
for i:=2 to n do
if i mod 2=0 then write(i:4);
writeln;
writeln('Cac so le chia het cho 3 trong khoang tu 1 toi ',n,' la: ');
for i:=1 to n do
if (i mod 2=1) and (i mod 3=0) then write(i:4);
writeln;
t:=0;
for i:=1 to n do
if i mod 2=1 then t:=t+i;
writeln('Tong cac so le trong khoang tu 1 toi ',n,' la: ',t);
if n>1 then
begin
kt:=0;
for i:=2 to n-1 do
if n mod i=0 then kt:=1;
if kt=0 then writeln(n,' la so nguyen to')
else writeln(n,' khong la so nguyen to');
end
else writeln(n,' khong la so nguyen to');
writeln('Cac so nguyen to trong khoang tu 2 toi ',n,' la: ');
for i:=2 to n do
begin
kt:=0;
for j:=2 to i-1 do
if i mod j=0 then kt:=1;
if kt=0 then write(i:4);
end;
writeln;
str(n,st);
d:=length(st);
t1:=0;
for i:=1 to d do
begin
val(st[i],x,y);
t1:=t1+x;
end;
writeln('Tong cac chu so cua ',n,' la: ',t1);
readln;
end.
giúp mk câu b với c gấp ạ mk tick cho