Advertisement
Guest User

Főr Julia(17)

a guest
Mar 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <cmath>
  2. #include <iostream>
  3. #include <set>
  4. using namespace std;
  5.  
  6. int cos(int x)
  7. {
  8. int s=0;
  9. for (int i=1;i<x;i++) s+=i;
  10. return s;
  11. }
  12.  
  13. int main()
  14. {
  15. int n,i,x,a[4];
  16. for (i=0;i<=3;i++) a[i]=0;
  17. cin >> n;
  18. for (i=1;i<=n;i++)
  19. {
  20. cin >> x;
  21. if (x%26==0) a[3]++;
  22. else
  23. if (x%13==0) a[2]++;
  24. else if (x%2==0) a[1]++;
  25. }
  26. cout << a[3]*(n-a[3])+cos(a[3])+a[2]*a[1];
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement