Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, x;
- cin >> n;
- int i = 1;
- int last = -1;
- while (i < n + 1) {
- cin >> x;
- if (x < 0) {
- last = i;
- }
- i++;
- }
- cout << last;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement