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.
Program ba_canh_cua_tam_giac;
uses crt;
var a,b,c: real;
BEGIN
Write('nhap do dai canh a'); Readln(a);
Write('nhap do dai canh b'); Readln(b);
Write('nhap do dai canh c'); Readln(c);
If (a<(b+c)) and (b<(c+a)) and (c<(b+a)) then write('do la do dai cua mot tam giac')
else write('do khong la do dai cua mot tam giac');
Readln;
END.
Thanks
bạn ơi viết chương trình bằng chữ hay là ở trong pascal z bạn
Bài 2:
#include <bits/stdc++.h>
using namespace std;
long long x,y;
int main()
{
cin >>x>>y;
cout<<x<<" "<<y;
swap(x,y);
cout<<x<<" "<<y;
return 0;
}
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.
#include <bits/stdc++.h>
using namespace std;
double a,b,c,h,p,s;
int main()
{
cin>>a>>b>>c;
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
if (s>50) cout<<"Dien tich tam giac lon hon";
else cout<<"Dien tich tam giac nho hon";
return 0;
}
c:
#include <bits/stdc++.h>
using namespace std;
long long a[1000],n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]%2==0) cout<<a[i]<<" ";
return 0;
}
d:
#include <bits/stdc++.h>
using namespace std;
long long a[1000],n,i,nn;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
nn=a[1];
for (i=1; i<=n; i++) nn=min(nn,a[i]);
cout<<nn;
return 0;
}
Program HOC24;
var a: array[1..32000] of integer;
i,n,d: integer;
begin
write('Nhap N: ');
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Day vua nhap la: ');
for i:=1 to n do write(a[i],' '); writeln;
d:=0;
for i:=1 to n do if a[i]>0 then d:=d+1;
write('Co ',d,' so duong');
readln
end.
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.
Bài 1:
uses crt;
var a,b,c:real;
kt:boolean;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
if (a>0) and (b>0) and (c>0) then
begin
if (a+b>c) and (a+c>b) and (b+c>a) then
begin
kt:=false;
if sqr(a)=sqr(b)+sqr(c) then kt:=true;
if sqr(b)=sqr(a)+sqr(c) then kt:=true;
if sqr(c)=sqr(a)+sqr(b) then kt:=true;
if kt=false then writeln('day khong la ba canh trong mot tam giac vuong')
else writeln('day la ba canh trong mot tam giac vuong');
end
else writeln('day khong la ba canh trong mot tam giac');
end
else writeln('vui long nhap ba so duong');
readln;
end.
Bài 2:
uses crt;
var n,i:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
if (n mod i=0) and (i mod 2=0) then write(i:4);
readln;
end.
Bài 3:
uses crt;
var n,i,j:integer;
begin
clrscr;
write('n='); readln(n);
for i:=2 to n do
begin
writeln('bang cuu chuong ',i,' la: ');
for j:=1 to 10 do
write(j*i,' ');
writeln;
end;
readln;
end.
Bài 4:
uses crt;
var n,i:integer;
begin
clrscr;
write('n='); readln(n);
if n>0 then
begin
for i:=0 to n do
if i mod 2=1 then write(i:4);
end
else writeln('vui long nhap n la so nguyen duong');
readln;
end.
Bài 5:
uses crt;
var a,b,c,d,max:integer;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
write('d='); readln(d);
max:=a;
if max<b then max:=b;
if max<c then max:=c;
if max<d then max:=d;
writeln('so lon nhat la: ',max);
readln;
end.