+ 2

Help me in code

question is in code as a comment. https://code.sololearn.com/cwGd7bC0oce3/?ref=app

28th Dec 2017, 7:32 AM
Sad
Sad - avatar
8 odpowiedzi
+ 5
i thought it checks if the string contain the names u use in variables
28th Dec 2017, 7:47 AM
Maher Zaidoune
Maher Zaidoune - avatar
+ 5
only one string u mean one word i think , so u could check if it has a space
28th Dec 2017, 7:57 AM
Maher Zaidoune
Maher Zaidoune - avatar
+ 4
just change the second if statement with else , and remove the comment condition
28th Dec 2017, 7:37 AM
Maher Zaidoune
Maher Zaidoune - avatar
28th Dec 2017, 7:38 AM
Maher Zaidoune
Maher Zaidoune - avatar
+ 4
u read just one string , u use the scanner one time ,what does that code supposed to do??
28th Dec 2017, 7:45 AM
Maher Zaidoune
Maher Zaidoune - avatar
+ 3
//here is my approach String[] words=f.split("\\s"); if(words.length > 1) { System.out.println("NO"); }else{ if(f.contains(a)......){......... } }
28th Dec 2017, 7:42 AM
MR Programmer
MR Programmer - avatar
+ 1
It does not work. I entered 2 Strings and it still outputed yes.
28th Dec 2017, 7:39 AM
Sad
Sad - avatar
+ 1
It has to check if input contains any of strings that i have declared and it will print yes. but input should contain only one string and not more. if it contains 2 or more, no should be printed.It is practise code so nothing serious.
28th Dec 2017, 7:54 AM
Sad
Sad - avatar