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.
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cout << "Nhap a!"; cin >> a;
cout << "Nhap b!"; cin >> b;
cout << "Nhap c!"; cin >> c;
((a + b) > c && (a + c) > b && (b + c) > a)?
cout << "Co! Ba So" << " " << a << " " << b << " " << c << " Tao Thanh Ba Do Dai Canh Cua Mot Hinh Tam Giac!" :
cout << "Khong! Ba So" << " " << a << " " << b << " " << c << " Khong Tao Thanh Ba Do Dai Canh Cua Mot Hinh Tam Giac!";
}
a = float(input("Nhap a : "))
b = float(input("Nhap b : "))
c = float(input("Nhap c : "))
if a+b>c and a+c>b and b+c>a:
if a==b or a==c or b==c:
if a==c==b:
print("Day la ba canh cua tam giac deu")
else:
print("Day la ba canh cua tam giac can")
elif (a**2)+(b**2)==c**2 or (a**2)+(c**2)==b**2 or (c**2)+(b**2)==a**2:
print("Day la ba canh cua tam giac vuong")
else:
pass
else:
print("Day khong phai ba canh cua tam giac")
#include<iostream>
using namespace std;
int main() {
double a, b, c;
cout << "Canh 1: "; cin >> a;
cout << "Canh 2: "; cin >> b;
cout << "Canh 3: "; cin >> c;
if (a > 0 && b > 0 && c > 0) {
if (a < b + c || b < a + c || c < a + b) {
cout << "Day la do dai ba canh cua mot tam giac";
} else {
cout << "Day khong phai do dai ba canh cua mot tam giac";
}
}else {
cout << "Do dai cac canh cua mot tam giac phai lon hon 0";
}
return 0;
}
program tamgiac;
var a,b,c: longint;
begin
write('Nhap canh b= ');readln(b);
write('Nhap canh c= ');readln(c);
if (a>b+c) or (b>a+c) or (c>a+b) then writeln('Day khong phai la ba canh tam giac')
else if (a=b) or(b=c) or (a=c) then writeln('Day la tam giac can')
else if (a=b) and (b=c) then writeln('Day la tam giac dau')
else if (sqr(a)=sqr(b)+sqr(c)) or (sqr(b)=sqr(c)+sqr(a)) or (sqr(c)=sqr(a)+sqr(b)) then writeln('Day la tam giac vuong')
else writeln('Day la tam giac thuong');
readln
end.
Program Bai1;
Uses crt;
Var a,b,c:integer;
Begin
CLRSCR;
Write('a='); Readln(a);
Write('b='); Readln(b);
Write('c='); Readln(c);
If (a*a=b*b+c*c) then Write('a,b,c la cac canh cua 1 tam giac vuong')
else('a,b,c khong phai la cac canh cua 1 tam giac vuong');
Readln
END.
program kiem_tra;
uses crt;
var a,b,c:integer;
begin
write('nhập số a');readln(a);
write('nhập số b');readln(b);
write('nhập số c');readln(c);
if(a*a=b*b+c*c)or(b*b=c*c+a*a)or(c*c=b*b+a*a)then writeln('đây là tam giác vuông') else writeln('đây là tam giác thường');
readln;
end.
Câu 1:
uses crt;
var a,s,p:real;
begin
clrscr;
repeat
write('Nhap do dai canh hinh vuong:'); readln(a);
until a>0;
p:=4*a;
s:=sqr(a);
writeln('Chu vi hinh vuong la: ',p:4:2);
writeln('Dien tich hinh vuong la: ',s);
readln;
end.
Câu 2:
uses crt;
var a,b,t,s,h:real;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
t:=a+b;
h:=a-b;
s:=a*b;
writeln('Tong la: ',t:4:2);
writeln('Hieu la: ',h:4:2);
writeln('Tich la: ',s:4:2);
readln;
end.
Câu 3:
uses crt;
var a,b,c:real;
begin
clrscr;
repeat
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
write('Nhap c='); readln(c);
until (a>0) and (b>0) and (c>0);
if (a+b>c) and (a+c>b) and (b+c>a) then writeln('Day la ba canh trong mot tam giac')
else writeln('Day khong la ba canh trong mot tam giac');
readln;
end.
1.
program bai1;
uses crt;
var t1,t2,max: integer;
begin
clrscr;
write('nhap so thu nhat ='); readln(t1);
write('nhap so thu hai ='); readln(t2);
max:=t1;
if max > t2 then write('so lon nhat la so thu nhat ') else
write('so lon nhat la so thu 2 hai ');
readln;
end.
2.
program bai2 ;
uses cer;
var a,b,c,d,max: integer;
begin
clrscr;
write('nhap so thu nhat ='); readln(a);
write('nhap so thu hai ='); readln(b);
write('nhap so thu ba ='); readln(c);
write('nhap so thu tu ='); readln(d):
max:=a;
if max > b then write('so lon nhat la so ',a,' ') else
write('so lon nhat la so ',b,'');
if max > c then write('so lon nhat la so ',a,' ') else
write('so lon nhat la so ',c,' ');
if max > d then write('so lon nhat la so ',a,' ') else
write('so lon nhat la so ',d,'');
readln;
end.