Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.io.IOException;
- public class Main {
- public static void main(String[] args) throws Exception {
- Scanner scan = new Scanner(System.in);
- final int N = 3;
- int a=0, b=0;
- for (int i=0; i < N; i++)
- {
- int value = scan.nextInt();
- if (value > 0)
- a++;
- if (value < 0)
- b++;
- }
- System.out.println("количество отрицательных чисел: "+b);
- System.out.println("количество положительных чисел: "+a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement