import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
if(a > 0 && b > 0 && c > 0)
{
System.out.println(3);
}
else if(a > 0 && b > 0 && c < 0)
{
System.out.println(2);
}
else if(a > 0 && b < 0 && c >0)
{
System.out.println(2);
}
else if(a < 0 && b > 0 && c > 0)
{
System.out.println(2);
}
else if(a > 0 && b < 0 && c < 0)
{
System.out.println(1);
}
else if(a < 0 && b > 0 && c < 0)
{
System.out.println(1);
}
else if(a < 0 && b < 0 && c > 0)
{
System.out.println(1);
}
else if(a <= 0 && b <= 0 && c <= 0)
{
System.out.println(0);
}
}
}
hidden #10528391
Level 6
Note that 0 is not a positive or negative number. whats that mean
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Roman
2 October 2019, 12:50
c) if you enter the numbers
0
1
2
then we display
2
Does your code follow this example?
0
hidden #10528391
28 September 2019, 11:51
output is correct but still not satisfying last condition please help me with my code
0