Advertisement
Slyke

Untitled

Sep 14th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. Scanner kb= new Scanner (System.in);
  2.  
  3. String inputString=kb.next();
  4.  
  5. boolean result=false;
  6.  
  7. for (int i=0; i<inputString.length-2; i++)
  8. //Loop how ever many letters there are minus 2 times
  9. {
  10.   if (inputString.substr(i,1)=="b" && inputString.substr(i+2,1)) {
  11.     result=true;
  12.   }
  13.  
  14. }
  15.  
  16. System.out.println(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement