Advertisement
Filip13

poslednja negativna temperatura

Oct 27th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, x;
  7. cin >> n;
  8. int i = 1;
  9. int last = -1;
  10.  
  11. while (i < n + 1) {
  12. cin >> x;
  13.  
  14. if (x < 0) {
  15. last = i;
  16. }
  17.  
  18. i++;
  19. }
  20.  
  21. cout << last;
  22.  
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement