BlueBook - Find the Character

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Problem type
BlueBook

Write a program that takes as input a single character and then a sentence, terminated by a period. The program should echo-print the input (that is, print it in the form in which it was read) and give a count of the number of times that the character appears in the sentence. Your program should not be case-sensitive - that is, uppercase letters should be considered equivalent to the corresponding lowercase letters.

Input Specification

The first line of the input consists of one character. The second line of the input consists of a sentence terminated by a period.

Output Specification

Output the sentence on one line and then the number of times the character appears in the sentence on another line.

Sample Input 1

o
Why so serious son.

Sample Output 1

Why so serious son.
3

Sample Input 2

y
You want the truth? You can't handle the truth.

Sample Output 2

You want the truth? You can't handle the truth.
2

Comments

There are no comments at the moment.