cho dãy số nguyên. viết a tính tích các số chia hết cho 5
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[15],n,i,dem;
int main()
{
freopen("songuyen.inp","r",stdin);
freopen("ketqua.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
dem=0;
for (i=1; i<=n; i++)
if (a[i]%3==0) dem++;
cout<<dem;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n,t;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
t=0;
for (i=1; i<=n; i++) t+=a[i];
cout<<t<<endl;
sort(a+1,a+n+1);
for (i=1; i<=n; i++) cout<<a[i]<<" ";
return 0;
}
uses crt;
const fi='xau.doc';
var st:string;
f1:text;
i,d:integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
readln(st);
d:=length(st);
delete(st,1,3);
writeln(f1,st);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,x;
//chuongtrinhcon
bool ktnt(long long x)
{
if (x<2) return false;
for (int i=2; i*i<=x; i++)
if (x%i==0) return(false);
return true;
}
//chuongtrinhchinh
int main()
{
freopen("dl.dat","r",stdin);
freopen("kq.dat","w",stdout);
cin>>n;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (ktnt(x)) dem++;
}
cout<<dem;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
string st,d;
int main()
{
freopen("dkt.inp","r",stdin);
cin>>st;
d=st.length();
for (int i=0; i<=d-1; i++)
st[i]-=32;
cout<<st;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int a[1000],n,i;
int main()
{
freopen("dayso.inp","r",stdin);
freopen("dayso.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]%2==0 && a[i]<0) cout<<a[i]<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long x,n,i,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%5==0) s=s*x;
}
cout<<s;
return 0;
}