Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int n,m,k,b=1,sum=0;
- cin>>n>>m>>k;
- int a[n];
- for(int i=0;i<n;i++)
- {
- b=1;
- cin>>a[i];
- for(int j=0;j<m;j++)
- b*=a[i];
- b*=a[i];
- if(b%k==0)sum++;
- }
- cout<<sum;
- }
Add Comment
Please, Sign In to add comment