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<0) cout<<"la so am";
else cout<<"la so duong";
return 0;
}
Tham khảo nhen
Program Tin_hoc;
var a: integer;
begin
write('Nhap a: '); readln(a);
if a=0 then write('a la so 0') else
if a mod 2=0 then write(a,' la so chan') else write(a,' la so le');
readln
end.
Tham khảo
Program Tin_hoc;
var a: integer;
begin
write('Nhap a: '); readln(a);
if a=0 then write('a la so 0') else
if a mod 2=0 then write(a,' la so chan') else write(a,' la so le');
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ẻ";
}
#include <bits/stdc++.h>
using namespace std;
long long x,n,i,t,dem;
int main()
{
cin>>n;
dem=0;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0 && x>10) t+=x;
if (x%2!=0 || x<100) dem++;
}
cout<<t<<" "<<dem;
return 0;
}
uses crt;
var a:array[1..100]of integer;
i,n,tc,tl,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
tc:=0;
tl:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then tc:=tc+a[i]
else tl:=tl+a[i];
end;
writeln('Tong cac so chan la: ',tc);
writeln('Tong cac so le la: ',tl);
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Tong cua day so la: ',t);
readln;
end.
uses crt;
var a:array[1..100]of integer;
n,i:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Cac phan tu chan la: ');
for i:=1 to n do
if a[i] mod 2=0 then write(a[i]:4);
readln;
end.
program im_14424;
uses crt;
var m: interger;
begin
clrscr;
write('Nhap vap so nguyen duong m: ');
readln(m);
if m>0 and m mod 2 = 0 then write('So nguyen duong m la so chan');
if m>0 and m mod 2 <> 0 then write('So nguyen duong m la so le);
if m<0 then write('m khum phai la so nguyen duong');
readln
end.
uses crt;
var C : array [1 .. 50] of integer;
i, n : integer;
begin
clrscr;
write('Nhap so phan tu : '); readln(n);
write('Nhap day gom ', n ,' so : ');
for i := 1 to n do read(C[i]);
write('Cac gia tri chan : ');
for i := 1 to n do
if C[i] mod 2 = 0 then write(C[i], ' ');
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;
}