fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin>>n;
  7. int a[n];
  8. for(int i=0; i<n; i++){
  9. cin>>a[i];
  10. }
  11. int k=0, s=0, p=1;
  12. for(int i=0; i<n; i++){
  13. if(a[i]<0) k++;
  14. if(a[i]%2!=0) s+=a[i];
  15. if(-5<=a[i] and a[i]<=5)
  16. p*=a[i];
  17. }
  18. cout<<k<<" "<<s<<" "<<p<<" "<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5280KB
stdin
10
33 45 16 -27 -23 -30 18 14 2 14

stdout
3 28 2