Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ChristmasGifts
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- int kids = 0;
- int adults = 0;
- while (input != "Christmas")
- {
- int years = int.Parse(input);
- if (years <= 16)
- {
- kids++;
- }
- else
- {
- adults++;
- }
- input = Console.ReadLine();
- }
- int kidsPrice = kids * 5;
- int adultsPrice = adults * 15;
- Console.WriteLine($"Number of adults: {adults}");
- Console.WriteLine($"Number of kids: {kids}");
- Console.WriteLine($"Money for toys: {kidsPrice}");
- Console.WriteLine($"Money for sweaters: {adultsPrice}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement