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