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.
Đề 3:
Câu 2:
#include <bits/stdc++.h>
using namaspace std;
long long x,n,i,dem;
int main()
{
cin>>n;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0 && i%2!=0) dem++;
}
cout<<dem;
return 0;
}
đề 1
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n,i,x,ans=0,cnt3=0,cnt5=0;
cin>>n;
for(i=0;i<n;i++)
{
cin>>x;
if(x%3==0)
cnt3++;
if(x%5==0)
cnt5++;
}
cout<<"so luong phan tu chia het cho 3 la: "<<cnt3;
cout<<"\nso luong phan tu chia het cho 5 la: "<<cnt5;
return 0;
}
Program HOC24;
var a: array[1..32000] of integer;
ucln,i,n,ucln1: integer;
function uc(x,y: integer): integer;
var tg: integer;
begin
while y<>0 do
begin
tg:=x mod y;
x:=y;
y:=tg;
end;
uc:=x;
end;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
ucln1:=uc(a[1],a[2]);
for i:=3 to n do ucln:=uc(ucln1,a[i]);
write('Uoc chung lon nhat cua day so la: ',ucln);
readln
end.
program bai1;
var
begin
write('Ten cua ban la ');readln(ten);
write('Nam hien tai la ');readln(nht);
write('Nhap nam sinh ');readln(ns);
write('Ban hoc lop ');readln(lop);
tuoi:=nht-ns;
writeln('Ten cua ban la ',tuoi);
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long a[10000],n,i;
int main()
{
freopen("bai2.inp","r",stdin);
freopen("bai2.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=n; i>=1; i--) cout<<a[i]<<" ";
return 0;
}
Câu 3:
#include <bits/stdc++.h>
using namespace std;
long long a;
int main()
{
cin>>a;
if (a%2==0) cout<<"La so chan";
else cout<<"La so le";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long n,i,k,x,a[1000];
int main()
{
cin>>n>>k;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]==k)
{
cout<<"YES";
return 0;
}
cout<<"NO";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a[10000],i,n;
int main()
{
freopen("bai2.inp","r",stdin);
freopen("bai2.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++)
cin>>a[i];
for (i=1; i<=n; i++)
cout<<a[i]<<" ";
return 0;
return 0;
}