Advertisement
knyazer

Untitled

Dec 8th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. Scanner sc = new Scanner(System.in);
  2. int n = sc.nextInt(), res = 0;
  3.  
  4. int[] arr = new int[n];
  5.  
  6. for (int i = 0; i < n; i++)
  7. {
  8. arr[i] = sc.nextInt();
  9.  
  10. if (arr[i] < 0)
  11. res++;
  12. }
  13.  
  14. System.out.println(res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement