Advertisement
Graf_Rav

Untitled

May 21st, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.     int n;
  7.     cin>>n;
  8.    
  9.    
  10.     int k6=0, k3=0, k2=0, k1=0;
  11.     for(int i=0;i<n;i++){
  12.         int a;
  13.         cin>>a;
  14.         if(a%6==0){
  15.             k6++;
  16.         }
  17.         else if(a%3==0){
  18.             k3++;
  19.         }
  20.         else if(a%2==0){
  21.             k2++;
  22.         }
  23.         else{
  24.             k1++;
  25.         }
  26.     }
  27.    
  28.     cout<<k6*k1+k3*k2;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement