https://www.codechef.com/problems/INTEST
In C++........................................
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,a;
cin>>n>>k;
int count=0;
while(n--)
{
cin>>a;
if(a%k==0)
{
count++;
}
}
cout<<count<<endl;
return 0;
}
In C++........................................
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,a;
cin>>n>>k;
int count=0;
while(n--)
{
cin>>a;
if(a%k==0)
{
count++;
}
}
cout<<count<<endl;
return 0;
}
No comments:
Post a Comment