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 <bits/stdc++.h>
using namespace std;
double xa,ya,xb,yb,xc,yc,ab,ac,bc,am;
int main()
{
cin>>xa>>ya>>xb>>yb>>xc>>yc;
ab=sqrt(pow(xa-xb,2)+pow(ya-yb,2));
ac=sqrt(pow(xa-xc,2)+pow(ya-yc,2));
bc=sqrt(pow(xb-xc,2)+pow(yb-yc,2));
cout<<"AB="<<fixed<<setprecision(2)<<ab<<endl;
cout<<"AC="<<fixed<<setprecision(2)<<ac<<endl;
cout<<"BC="<<fixed<<setprecision(2)<<bc<<endl;
am=((2*(ac*ac+bc*bc)-ab*ab)/4);
cout<<"AM="<<fixed<<setprecision(2)<<sqrt(am)<<endl;
return 0;
}
Bài 2:
#include <bits/stdc++.h>;
using namespace std;
int main();
{
long m,n;
cout<<"Nhap m="; cin>>m;
cout<<"Nhap n="; cin>>n;
cout<<m*n-2;
return 0;
}
uses crt;
var a,b,c:string;
i,d1,d2:integer;
begin
clrscr;
write('Nhap xau a:'); readln(a);
write('Nhap xau b:'); readln(b);
d1:=length(a);
d2:=length(b);
writeln('Tong do dai hai xau la: ',d1+d2);
c:=#32;
for i:=1 to d1 do
if (a[i] in ['A'..'Z']) or (a[i] in ['a'..'z']) then c:=c+a[i];
for i:=1 to d2 do
if b[i] in ['0'..'9'] then c:=c+b[i];
writeln('Xau c la: ',c);
readln;
end.
uses crt;
var a:array[1..200]of integer;
n,i,k,t,t1:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
t:=0;
for i:=1 to n do
if a[i] mod 2<>0 then t:=t+a[i];
t1:=0;
for i:=1 to n do
if a[i] mod k=0 then t1:=t1+a[i];
writeln('Tong cac phan tu le la: ',t);
writeln('Tong cac phan tu la boi cua ',k,' la: ',t1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
string st;
int d,i;
int main()
{
getline(cin,st);
d=st.length()
for (i=0; i<=d-1; i++)
if (('a'<=st[i]) and (st[i]<='z')) st[i]=st[i]+32;
for (i=0; i<=d-1; i++)
cout<<st[i];
return 0;
}
uses crt;
var a,b,c:string;
i,d1,d2:integer;
begin
clrscr;
write('Nhap xau a:'); readln(a);
write('Nhap xau b:'); readln(b);
d1:=length(a);
d2:=length(b);
writeln('Tong do dai hai xau la: ',d1+d2);
c:=#32;
for i:=1 to d1 do
if (a[i] in ['A'..'Z']) or (a[i] in ['a'..'z']) then c:=c+a[i];
for i:=1 to d2 do
if b[i] in ['0'..'9'] then c:=c+b[i];
writeln('Xau c la: ',c);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double xa,ya,xb,yb,xc,yc,ab,ac,bc;
int main()
{
cin>>xa>>ya>>xb>>yb>>xc>>yc;
ab=(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)));
ac=(sqrt((xa-xc)*(xa-xc)+(ya-yc)*(ya-yc)));
bc=(sqrt((xb-xc)*(xb-xc)+(yb-yc)*(yb-yc)));
p=(ab+bc+ac)/2;
s=sqrt(p*(p-ab)*(p-ac)*(p-bc));
cout<<"Dien tich la:"<<fixed<<setprecision(2)<<s<<endl;
cout<<"Duong cao ung voi dinh A la:"<<fixed<<setprecision(2)<<2*s/bc<<endl;
cout<<"Duong cao ung voi dinh B la:"<<fixed<<setprecision(2)<<2*s/ac<<endl;
cout<<"Duong cao ung voi dinh C la:"<<fixed<<setprecision(2)<<2*s/ab<<endl;
return 0;
}