Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <math.h>
- #include <conio.h>
- using namespace std;
- int main() {
- int N, a, kol[3] = {};
- int m;
- cin >> N;
- for (int i = 0; i < N; i++)
- {
- cin >> a;
- if (a%2 == 0 && a%3 != 0)
- {
- kol[0]++;
- }
- if (a%3 == 0 && a%2 != 0)
- {
- kol[1]++;
- }
- if (a%6 == 0)
- {
- kol[2]++;
- }
- }
- m = (kol[2])*0.5*(kol[2]-1) + (kol[1] * kol[0]) + (kol[2]*(N-kol[2]));
- cout << m;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement