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.
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long n,i,x,dem,t;
int main()
{
cin>>n;
dem=0;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0)
{
dem++;
t=t+x;
}
}
cout<<dem<<" "<<t;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
Bài 1:
#include <bits/stdc++.h>
using namespace std;
long long n,x,i,t1,t2;
int main()
{
cin>>n;
t1=0; t2=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0) t1=t1+x;
else t2=t2+x;
}
cout<<t1<<" "<<t2;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long n,x,k,i,dem;
int main()
{
cin>>n>>k;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x==k) dem=dem+1;
}
cout<<dem;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long x,i,n,nn;
int main()
{
cin>>n;
int dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x==0) dem++;
}
cout<<dem;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long x,i,n,dem;
int main()
{
cin>>n;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x<0) dem++;
}
cout<<dem;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long n,i,x;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2!=0) cout<<x<<" ";
}
return 0;
}
2:
#include <bits/stdc++.h>
using namespace std;
int i,dem,s;
int main()
{
dem=0;
s=0;
for (i=1; i<=100; i++)
if (i%2==0)
{
dem++;
s=s+i;
}
cout<<fixed<<setprecision(2)<<(s*1.0)/(dem*1.0);
return 0;
}