HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


50316 - Population Bar Chart

Guest
• Review clarifications (1)

Volume problems

• 074. 50396 - Cinema Tickets - 1
• 080. 50248 - Power of two
• 090. 50456 - nth Digit of a Number
• 110. 50288 - Even numbers in even...
• 115. 50425 - Calculating Weekly Pay
• 120. 50426 - Calculating Sales
• 50312 - Sales Bar Chart
• 50313 - Pattern Displays
• 50316 - Population Bar Chart
• 50336 - Buying Carpets
• 50295 - Weighted Average
• 003. 50358 - Series of Odd Numbers
• 005. 50297 - Divisible By Five
• 012. 50589 - The Number of Eggs Sold
• 030. 50584 - Total invoice amount
• 050. 50450 - Last Appereance of a ...
• 060. 50362 - Pythagorean Numbers

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Halil Karimis.

Population Bar Chart

Question:
Write a program that produces a bar chart showing the population growth of Prairieville, a small town in the Midwest, at 50-year intervals during the past 100 years.

The program will get the population for the years 1900, 1950, and 2000 from the user. For each year, it should display the year and a bar consisting of one asterisk for each 1,000 people.

Input specification
You will be given three integers in three lines representing the population (p) in the years 1900, 1950 and 2000 where 0 < p < 10000

Output specification
Print out three lines. Every line will contain the year followed by a space and proper number of asterisks.
Note: The population is rounded to the nearest 1,000 people.

Sample Run I  
2800
4560
6220

Sample Output I  
1900 ***
1950 *****
2000 ******

Sample Input II  
5700
3200
4500

Sample Output II  
1900 ******
1950 ***
2000 *****


Для отправки решений необходимо выполнить вход.

www.contester.ru