Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int n;
- cin>>n;
- int k6=0, k3=0, k2=0, k1=0;
- for(int i=0;i<n;i++){
- int a;
- cin>>a;
- if(a%6==0){
- k6++;
- }
- else if(a%3==0){
- k3++;
- }
- else if(a%2==0){
- k2++;
- }
- else{
- k1++;
- }
- }
- cout<<k6*k1+k3*k2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement