Advertisement
bogolyubskiyalexey

Untitled

Sep 7th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. public class Main {
  2.     public static void main(String[] args) throws Exception {
  3.        
  4.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  5.         final int N = 3;
  6.         int a=0, b=0;
  7.         for (int i=0; i < N; i++)
  8.         {
  9.             int value =  Integer.parseInt(reader.readLine());
  10.             if (value > 0)
  11.                 a++;
  12.             if (value < 0)
  13.                 b++;
  14.         }
  15.         System.out.println("количество отрицательных чисел: "+b);
  16.         System.out.println("количество положительных чисел: "+a);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement