Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner kb= new Scanner (System.in);
- String inputString=kb.next();
- boolean result=false;
- for (int i=0; i<inputString.length-2; i++)
- //Loop how ever many letters there are minus 2 times
- {
- if (inputString.substr(i,1)=="b" && inputString.substr(i+2,1)) {
- result=true;
- }
- }
- System.out.println(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement