velimir

mokenArtefakt

Jan 22nd, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7.     int i, x, y, z, n;
  8.     cin >> z;
  9.     y = z;
  10.     for(i=1; i<=z; i++)
  11.     {
  12.         cin >> x;
  13.         y = y-(x+1);
  14.         if(y <= 0) goto loop;
  15.     }
  16.     loop:
  17.     for(n = i; n<z; n++) cin >> x;
  18.     cout << i;
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment