fork download
  1. //Bai 1
  2.  
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5. #define el "\n"
  6. #define ll long long
  7. #define ull unsigned long long
  8. #define se second
  9. #define fi first
  10. #define be begin
  11. #define en end
  12. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  13. void Run(int n, int a[])
  14. {
  15. ll ans = 0;
  16. for(int i = 0; i < n; i++)
  17. {
  18. cin >> a[i];
  19. if(a[i] % 5 == 0) ans += 1ll*a[i];
  20. }
  21. cout << ans;
  22. }
  23. int main()
  24. {
  25. Faster;
  26. int n; cin >> n;
  27. int a[n];
  28. Run(n, a);
  29. return 0;
  30. }
  31.  
  32.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
-23485442170