knyazer

Untitled

Dec 1st, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. import static java.lang.Math.*;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String[] args) {
  8. Scanner sc = new Scanner(System.in);
  9.  
  10. int n = sc.nextInt(), ans = 0;
  11. for (int i = 0; i < n; i++)
  12. {
  13. int x = sc.nextInt();
  14. if (x > 0)
  15. ans++;
  16. }
  17.  
  18. System.out.println(ans);
  19. }
  20. }
Add Comment
Please, Sign In to add comment