Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("bac.in");
- int main()
- {
- int neg1 = -1, neg2;
- int x;
- int poz = 1;
- while(fin >> x)
- {
- if(x < 0 && neg1 == -1)
- neg1 = poz;
- if(x < 0)
- neg2 = poz;
- poz++;
- }
- poz = poz - 1;
- int d1 = poz - neg1 + 1;
- cout << max(d1, neg2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement