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