-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIf18.java
More file actions
25 lines (23 loc) · 616 Bytes
/
If18.java
File metadata and controls
25 lines (23 loc) · 616 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
package ifdirect;
import java.util.Scanner;
public class If18 {
public static void main(String[] args) {
Scanner scanner=new Scanner (System.in);
int a,b,c,p=3;
System.out.print ("1.a=");
a=scanner.nextInt ();
System.out.print ("2.b=");
b=scanner.nextInt ();
System.out.print ("3.c=");
c=scanner.nextInt ();
if ( a==b ){
System.out.println (p);
} else if ( c==a) {
p-=1;
System.out.println (p);
} else if (b==c) {
p-=2;
System.out.println (p);
}
}
}