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.
uses crt;
var a,b,c,p,s:real;
begin
clrscr;
repeat
write('Nhap a='); readln(a);
write('Nhap b=');c 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
begin
kt:=0;
if sqr(a)=sqr(b)+sqr(c) then kt:=1;
if sqr(b)=sqr(a)+sqr(c) then kt:=1;
if sqr(c)=sqr(a)+sqr(b) then kt:=1;
if kt=0 then writeln('Day khong la tam giac vuong')
else begin
writeln('Day la ba canh trong mot tam giac vuong');
p:=(a+b+c)/2;
s:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln('Dien tich tam giac vuong la: ',s:4:2);
end;
end
else writeln('Day khong la ba canh trong mot tam giac');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,x,t;
int main()
{
cin>>n;
t=0;
for (i=1;i<=n; i++)
{
cin>>x;
if ((x<0) and (x%2!=0)) t=t+x;
}
cout<<t;
return 0;
}
2:
#include <bits/stdc++.h>
using namespace std;
long long a[100],n,i,t,k;
int main()
{
cin>>n>>k;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%k==0) t=t+x;
}
cout<<t;
return 0;
}
Program So_nguyen;
uses crt;
Var a,b,t:integer;
Begin
clrscr;
Writeln(' Nhap 2 so nguyen a va b:');
if a>b then t:= a-b;
if a<b then t:=b-a;
if a=b then t:=0;
Writeln(' Ket qua la',t);
Readln;
End.
#include <bits/stdc++.h>
using namespace std;
const long long maxn=1e5+10;
long long a[maxn],i,n,x,l,r,m;
//chuongtrinhcon
long long tknp(long long a[],long long l,long long r,long long x)
{
while (l<=r)
{
long long g=(l+r)/2;
if (a[g]==x) return(g);
if (x>a[g]) l=g+1;
else r=g-1;
}
return(-1);
}
int main()
{
freopen("tknp.inp","r",stdin);
freopen("tknp.out","w",stdout);
cin>>n>>x;
for (i=1; i<=n; i++)
cin>>a[i];
cout<<tknp(a,1,n,x);
return 0;
}
Program tinh;
Uses crt;
Var
a,b,tong,hieu:Integer;
Begin
If a>=b then ( neu a lon hon hoac bang b thi thong bao );
Write('nhap so a la');readln(a)
Write('nhap so b la');readln(b)
tong:=a+b
hieu:a-b
Writeln('tong hai so la',tong);
Writeln('hieu hai so la';hieu);
Readln;
End.