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.
Câu 1:
uses crt;
var a,b:integer;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
if (a>0) and (b>0) then writeln('Cung duong');
if (a<0) and (b<0) then writeln('Cung am');
if (a>0) and (b<0) then writeln('Duong am');
if (a<0) and (b>0) then writeln('Am duong');
readln;
end.
Câu 2:
uses crt;
var a,b:integer;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
if (a mod 2=0) and (b mod 2=0) then writeln('Cung chan');
if (a mod 2<>0) and (b mod 2<>0) then writeln('Cung le');
if (a mod 2=0) and (b mod 2<>0) then writeln('Chan le');
if (a mod 2<>0) and (b mod 2=0) then writeln('Le chan');
readln;
end.
Tham khảo:
uses crt;
Var a,b,i : Integer ;
Begin
Clrscr ;
Write ('Nhap a: '); readln (a);
Write ('Nhap b: '); readln (b);
i:=a + b;
If i mod 2 = 0 then writeln ('Tong hai so ',a,' va ',b,' la ',i,', day la mot so chan')
Else writeln ('Tong hai so ',a,' va ',b,' la ',i,', day la mot so le');
Readln ;
End.
#include <bits/stdc++.h>
using namespace std;
long long a,b,t;
int main()
{
cin>>a>>b;
t=a+b;
if (t>0) cout<<"Tong la so duong";
else if (t<0) cout<<"Tong la so am";
else cout<<"Tong la so 0";
cout<<endl;
if (t%2==0) cout<<"Tong co chia het cho 2";
else cout<<"Tong khong chia het cho 2";
return 0;
}
uses crt;
var a,b,c,p,s:real;
begin
clrscr;
readln(a,b,c);
if (a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a) then
begin
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
writeln('Chu vi la: ',p*2:4:2);
writeln('Dien tich la: ',s:4:2);
end
else writeln('a,b,c khong la ba canh cua tam giac');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
unsigned long long a,b;
int main()
{
cin>>a>>b;
if (a>b) swap(a,b);
cout<<a<<" "<<b;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
long long t=a+b;
if (t>0 && t%3==0) cout<<"YES";
else cout<<"NO";
return 0;
}
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
if (a<0) then writeln(a,' la so am')
else if (a>0) then writeln(a,' la so duong')
else writeln(a,' khong la so am cung khong la so duong');
if (b<0) then writeln(b,' la so am')
else if (b>0) then writeln(b,' la so duong')
else writeln(b,' khong la so am cung khong la so duong');
if (a>0) then writeln(sqr(a+b));
readln;
end.
#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!";
}
uses crt;
var a,b,c:real;
kt:integer;
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
begin
kt:=0;
if (a=b) and (a<>c) and (b<>c) then kt:=1;
if (b=c) and (b<>a) and (c<>a) then kt:=1;
if (c=a) and (c<>b) and (a<>b) then kt:=1;
if kt=0 then writeln('Day khong la tam giac can')
else writeln('Day la tam giac can');
end
else writeln('Day khong la ba canh trong mot tam giac');
readln;
end.
var a,b : integer;
begin
writeln('nhap so nguyen a:');
read(a);
writeln('nhap so nguyen b:');
read(b);
if ( a*b >= 0) then
writeln(' a va b cung dau');
else
writeln('a va b khac dau');
readln;
end.