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 a,b,c;
int main()
{
cin>>a>>b>>c;
if (a+c %2==0) cout<<"AC ";
if (b+c%2==0) cout<<"BC ";
if (a+b%2==0) cout<<"AB";
return 0;
}
uses crt;
var n,t:integer;
{------------------kiem-tra-so-nguyen-to----------------------------}
function ktnt(x:integer):boolean;
var i:integer;
kt:boolean;
begin
kt:=true;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then
begin
kt:=false;
break;
end;
if kt=true then ktnt:=true
else ktnt:=false;
{----------------------chuong-trinh-chinh------------------------}
begin
clrscr;
t:=0;
repeat
write('Nhap n='); readln(n);
if (n mod 2=0) then t:=t+n;
until ktnt(n)=false;
writeln(t);
readln;
end.
uses crt;
var x,n,d,i:longint;
st,st1:string;
a:integer;
{----------------------chuong-trinh-con-tim-ucln---------------------}
function ucln(a,b:longint):longint;
var t:longint;
begin
t:=b mod a;
while t<>0 do
begin
t:=a mod b;
a:=b;
b:=t;
end;
ucln := a;
end;
{-------------------chuong-trinh-chinh-----------------}
begin
clrscr;
write('nhap x='); readln(x);
str(x,st);
d:=length(st);
st1:='';
for i:=d downto 1 do
st1:=st1+st[i];
val(st1,n,a);
if ucln(x,n)=1 then writeln('Phai')
else writeln('khong phai');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n,t1,t2;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
t1=0;
t2=1;
for (i=1; i<=n; i++)
{
if (a[i]%2!=0) t1+=a[i];
else t2*=a[i];
}
cout<<t1<<endl;
cout<<t2<<endl;
return 0;
}
uses crt;
var n,i,chan,tonchan:integer;
a:array[1..100] of integer;
begin
write('nhap n '); readln(n);
for i:=1 to n do
begin
write('a[i]='); readln(a[i]);
end;
writeln("in cac phan tu trong mang");
for i:=1 to n do
begin
writeln(a[i]);
end;
writeln("in cac phan tu chan");
chan:=0;
for i:=1 to n do
if n mod 2=0 then begin writeln(a[i]); chan:=chan+1; end;
write('tong cac phan tu chan ',chan);
readln;
end.
Program HOC24;
var n,i: integer;
t: longint;
Begin
write('Nhap N: '); readln(N);
t:=0;
for i:=1 to n do t:=t+i;
if t mod 2=0 then write('Tong la so chan') else write('Tong la so le');
readln
end.
n = int(input('nhap n'))
s = 0
for i in range(0,n):
s = s+i
print('tong cua day tu 0 den '+n+'la'+s)
if s%2 == 0:
print('s la so chan')
else:
print('s la so le')