Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int i, k = 0, N, x = 0, j;
  6. int a[100];
  7. cin >> N;
  8. for (i = 0; i < N; i++)
  9. {
  10. cin >> a[i];
  11. }
  12. for (i = 0; i < N - 4 ; i++)
  13. {
  14. for (j = i + 4; j < N; j++)
  15. {
  16. if ((a[i] * a[j]) % 29 == 0)
  17. {
  18. k = k + 1;
  19. }
  20. }
  21. }
  22. cout << k;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement