if i'm runnig my code without verification in working correctly, but when i'm asking the verification
the system replay me tha last condition is not met.
my code:
package com.codegym.task.task04.task0424;
/*
Three numbers
*/
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner leggi = new Scanner(System.in);
int a = leggi.nextInt();
int b = leggi.nextInt();
int c = leggi.nextInt();
if (a!=b && a!=c){
System.out.println(1);
} else if (b!=a && b!=c){
System.out.println(2);
} else if (c!=a && c!=b){
System.out.println(3);
} else if (a!=b && a!=c && b!=c) {
}
}
Could you pls help me?
last condition not satisfied
Resolved
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Shuy
7 January 2020, 11:39
The thing is, if you would have for example : 5 , 7 , 9, you would print out 5, since it would pass the first if statement. But if you have 3 unique numbers, you should not display anything. If you still need help, just reply and I give you some more tips.
0