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;
long long n;
int main()
{
cin>>n;
if (n%2==0) cout<<"La so chan";
else cout<<"La so le";
return 0;
}
Tham khảo!
program baitap;
uses crt;
var a:integer;
procedure chanle(x:integer);
begin
if ((x mod 2) = 0) then write('So nhap vao la so chan.') else
write('So nhap vao la so le.');
end;
begin
clrscr;
write('Nhap a: ');readln(a);
chanle(a);
readln;
end
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
if (n%2==0) cout<<"Chan";
else cout<<"Le";
return 0;
}
Program Tin_hoc;
Uses Crt;
Var N: Integer;
Begin
Write('Nhap so nguyen N');
Readln(N);
If N>0 then write(' So do la so duong ');
If N<0 then write(' So do la so am ');
If N=0 then write(' So do khong la so am va so duong');
Readln;
End.
Program Tin_hoc;
Uses Crt;
Var N: Integer;
Begin
Write('Nhap so nguyen N');
Readln(N);
If N>0 then write(' So do la so duong ');
If N<0 then write(' So do la so am ');
If N=0 then write(' So do khong la so am va so duong');
Readln;
End.
TK:
uses crt;
var n: longint;
begin
clrscr;
readln(n);
if n mod 2 = 0 then writeln('Chan') else writeln('Le');
readln;
end.
#include<bits/stdc++.h>
using namespace std;
long long N;
int main()
{
cin>>N;
if(N%2==0) cout<<N<<" là số chẵn";
if(N%2!=0) cout<<N<<" là số lẻ";
}
Bài 1:
uses crt;
var m,n,i,t:integer;
begin
clrscr;
write('Nhap m='); readln(m);
write('Nhap n='); readln(n);
t:=0;
for i:=m to n do
t:=t+i;
writeln(t);
readln;
end.
2:
uses crt;
var n:integer;
{---------------chuong-trinh-con-kiem-tra-chan-le---------------------}
function ktcl(x:integer):boolean;
begin
if x mod 2=0 then ktcl:=true
else ktcl:=false;
end;
{--------------------chuong-trinh-con-kiem-tra-duong-am-------------------}
fucntion ktda(x:integer):boolean;
begin
if x>0 then ktda:=true
else if x<0 then ktda:=false;
end;
{--------------------chuong-trinh-chinh-------------------------}
begin
clrscr;
write('Nhap n='); readln(n);
if ktcl(n)=true then writeln('Day la so chan')
else writeln('Day la so le');
if ktda(n)=true then writeln('Day la so duong')
else writeln('Day la so am');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
bool kt=true;
for (int i=2; i*i<=n; i++)
if (n%i==0) kt=false;
if (kt==true && n>=2) cout<<"YES";
else cout<<"NO";
return 0;
}
python.
N = input(nhap so nguyen N)
if n%2 == 0:
print('N la so chan')
else:
print('N la so le')
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
if (n%2!=0) cout<<"La so le";
else cout<<"Khong la so le";
return 0;
}