fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define cc long long
  4. int main()
  5. {
  6. cc b,i;
  7. cin>>b;
  8. cc o[b],hh=0;
  9. for( i=0;i<b;i++)
  10. {
  11. cin>>o[i];
  12.  
  13. if((o[i]%2)!=0)
  14. {
  15. hh=hh+o[i];
  16. }
  17. }
  18. cout<<hh;
  19. }
Success #stdin #stdout 0.01s 5376KB
stdin
2
3
5 15 3 
2
70 100 
stdout
8