Respuesta :
Answer:
str = input("Input: ")
str = str.lower()
counts = str.count("sh")
print(counts)
Explanation:
I answered the question in Python programming language.
[This line prompts user for input]
str = input("Input: ")
[This line converts user input to lower case]
str = str.lower()
[This counts the occurrence of "sh" in the input string]
counts = str.count("sh")
[This prints the number of occurrence of "sh" in the user input]
print(counts)
Answer:
Scanner scan=new Scanner(System.in);
System.out.println("Input String:");
String str = scan.nextLine();
int count = 0;
str=str.toLowerCase();
for (int i = 0; i < str.length()-1; i++)
{
if (str.substring(i, i + 2).equals("sh"))
{
count++;
}
}
System.out.println("Contains \"sh\" " + count + " times.");
}
}
Explanation:
This is what I was able to get for Java.