Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.javarush.test.level04.lesson07.task03;
- /* Положительные числа
- Ввести с клавиатуры три целых числа. Вывести на экран количество положительных чисел в исходном наборе.
- Пример для чисел -4 6 6:
- 2
- Пример для чисел -6 -6 -3:
- 0
- */
- import java.io.*;
- public class Solution
- {
- public static void main(String[] args) throws Exception
- {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- int a,b,c,d;
- a = Integer.parseInt(reader.readLine());
- b = Integer.parseInt(reader.readLine());
- c = Integer.parseInt(reader.readLine());
- d = 0;
- if (a > 0)
- d+=1;
- if (b > 0)
- d+=1;
- if (c > 0)
- d+=1;
- System.out.println(d);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement