+ 3
Security Code Challange Problem
I dont know what is wrong with this code but all the tests are true except the fourth one. Please help! import java.util.*; public class Program { public static void main(String[] args) { Scanner inp = new Scanner(System.in); String floor = inp.nextLine().replace("x"," "); int count=0; if(floor.contains("T") == false){ System.out.println("quiet"); }else if(floor.contains("$T") || floor.contains("T
quot;)){ System.out.println("ALARM"); } else{ System.out.println("quiet"); } } }3 odpowiedzi
+ 4
Thanx man it worked
+ 1
You are replacing x with a space then it's no use to do that, replace with empty character "",
And it is security problem not secret message i think...
First if condition, according to input is always fails because all inputs contains T, no harm in code but no use...
0
What do you need the count for?