Advertisement
Josif_tepe

Untitled

Mar 9th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin>>n;
  9.     int niza[n];
  10.     for(int i=0;i<n;i++)
  11.     {
  12.         cin>>niza[i];
  13.     }
  14.  
  15.     int broj=0;
  16.     for(int i=0;i<n;i++)
  17.     {
  18.         for(int j=i;j<n;j++)
  19.         {
  20.            for(int l=i;l<=j;l++)
  21.            {
  22.                if(niza[l]==0)
  23.                {
  24.                   broj++;
  25.                   break;
  26.                }
  27.            }
  28.         }
  29.     }
  30.     cout<<broj;
  31.     return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement