C++ Exercises: Prints the word and a list of the corresponding page numbers
Word with Page Numbers
Write a C++ program that reads a list of pairs of a word and a page number, and prints the word and a list of the corresponding page numbers.
Sample Solution:
C++ Code :
Sample Output:
Sample Input: Python 2 HTML 4 CSS 3 Python 5 Python 3 HTML 2 CSS 6 Output: CSS 3 6 HTML 2 4 Python 2 3 5
Flowchart:

C++ Code Editor:
Previous: Write a C++ program to which replace all the words "dog" with "cat".
Next: Write a C++ program to convert a given number into hours and minutes. Separate the number of hours and minutes with a colon.
What is the difficulty level of this exercise?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics