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;
cin >> a >> b;
cout << (a+b)*2;
return 0;
}
Bài 1:
uses crt;
var a,b:real;
{----------------------------chuong-trinh-con-tinh-chu-vi-------------------------}
function chuvi(x,y:real):real;
begin
chuvi:=(x+y)*2;
end;
{----------------------------chuong-trinh-con-tinh-dien-tich----------------------}
function dientich(m,n:real):real;
begin
dientich:=m*n;
end;
{-----------------------------chuong-trinh-chinh--------------------------}
begin
clrscr;
repeat
write('Nhap chieu dai:'); readln(a);
write('Nhap chieu rong:'); readln(b);
until (a>0) and (b>0) and (a>=b);
writeln('Chu vi hinh chu nhat la: ',chuvi(a,b):4:2);
writeln('Dien tich hinh chu nhat la: ',dientich(a,b):4:2);
readln;
end.
Bài 2:
uses crt;
var a,b,c:real;
{----------------------------chuong-trinh-con-tinh-chu-vi-------------------------}
function chuvi(x,y,z:real):real;
begin
chuvi:=x+y+z;
end;
{----------------------------chuong-trinh-con-tinh-dien-tich----------------------}
function dientich(m,n,p:real):real;
var ncv:real;
begin
ncv:=(m+n+p)/2;
dientich:=sqrt(ncv*(ncv-m)*(ncv-n)*(ncv-p));
end;
{-----------------------------chuong-trinh-chinh--------------------------}
begin
clrscr;
repeat
write('Nhap canh thu 1:'); readln(a);
write('Nhap canh thu 2:'); readln(b);
write('Nhap canh thu 3:'); readln(c);
until (a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a);
writeln('Chu vi hinh tam giac la: ',chuvi(a,b,c):4:2);
writeln('Dien tich hinh tam giac la: ',dientich(a,b,c):4:2);
readln;
end.
Bài 3:
uses crt;
var r:real;
{----------------------------chuong-trinh-con-tinh-chu-vi-------------------------}
function chuvi(x:real):real;
begin
chuvi:=2*x*pi;
end;
{----------------------------chuong-trinh-con-tinh-dien-tich----------------------}
function dientich(m:real):real;
begin
dientich:=sqr(m)*pi;
end;
{-----------------------------chuong-trinh-chinh--------------------------}
begin
clrscr;
repeat
write('Nhap ban kinh:'); readln(r);
until r>0;
writeln('Chu vi hinh tron la: ',chuvi(r):4:2);
writeln('Dien tich hinh tron la: ',dientich(r):4:2);
readln;
end.
Bài 4:
uses crt;
var a,b:real;
{--------------------chuong-trinh-con-tinh-tong------------------------}
function tong(x,y:real):real;
begin
tong:=x+y;
end;
{--------------------chuong-trinh-con-tinh-hieu------------------------}
function hieu(m,n:real):real;
begin
hieu:=m-n;
end;
{--------------------chuong-trinh-con-tinh-tich------------------------}
function tich(c,d:real):real;
begin
tich:=c*d;
end;
{--------------------chuong-trinh-con-tinh-thuong-----------------------}
function thuong(p,q:real):real;
begin
thuong:=p/q;
end;
{--------------------chuong-trinh-chinh--------------------------------}
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
writeln('Tong cua hai so la: ',tong(a,b):4:2);
writeln('Hieu cua hai so la: ',hieu(a,b):4:2);
writeln('Tich cua hai so la: ',tich(a,b):4:2);
if b<>0 then writeln('Thuong cua hai so la: ',thuong(a,b):4:2)
else writeln('Khong tinh duoc thuong cua hai so vi so chia bang 0');
readln;
end.
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.
#include <bits/stdc++.h>
using namespace std;
double a,b,c,p,s;
int main()
{
cin>>a>>b>>c;
if (a+b>c && b+c>a && c+b>a)
{
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
cout<<fixed<<setprecision(2)<<s;
}
else cout<<"Day khong la ba canh trong mot tam giac";
return 0;
}