View difference between Paste ID: 5n2yK90Y and hn5kNPki
SHOW: | | - or go back to the newest paste.
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++)
7+
8-
//Loop how ever many letters there are minus 2 times
8+
if (inputString.length() => 3) {
9-
{
9+
  for (int i=0; i<inputString.length()-2; i++)
10-
  if (inputString.substr(i,1)=="b" && inputString.substr(i+2,1)) { 
10+
  //Loop how ever many letters there are minus 2 times
11-
    result=true;
11+
  {
12
    if (inputString.substr(i,1)=="b" && inputString.substr(i+2,1)=="b") { 
13
      result=true;
14
    }
15
16
  }
17
} else {
18
  result=false;
19
}
20
System.out.println(result);