-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathif19.java
More file actions
34 lines (28 loc) · 792 Bytes
/
if19.java
File metadata and controls
34 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package ifdirect;
import java.util.Scanner;
public class if19 {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int a,b,c,d,p=4;
System.out.println("1.a:");
a= scanner.nextInt();
System.out.println("2.b:");
b= scanner.nextInt();
System.out.println("3.c:");
c= scanner.nextInt();
System.out.println("4.d:");
d= scanner.nextInt();
if (a==b && b==c){
System.out.println(p);
}else if (a==b && b==d){
p--;
System.out.println(p);
}else if (a==c && c==d){
p-=2;
System.out.println(p);
} else if (b==c && c==d){
p-=3;
System.out.println(p);
}
}
}