Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cout<<"Podaj n: "; cin>>n;
- double tab[n];
- for(int i=0;i<n;i++)
- {
- cout<<"Podaj element: ";
- cin>>tab[i];
- }
- int ileZer(0);
- int maxi(-1);
- for(int i=0;i<n;i++)
- {
- if(tab[i]==0)
- {
- ileZer++;
- if(ileZer>maxi)
- maxi=ileZer;
- }
- else
- ileZer=0;
- }
- cout<<maxi;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement