fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a[1000],n,i,k=0;
  6. cin>>n;
  7. for(i=0;i<n;i++)
  8. {cin>>a[i];
  9. if (a[i]==0)k++;}
  10. cout<<k;
  11. return 0;
  12. }
Success #stdin #stdout 0s 5292KB
stdin
5 
0 4 0 4 5
stdout
2