Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TheatrePromotions
- {
- class Program
- {
- static void Main(string[] args)
- {
- string day = Console.ReadLine();
- int age = int.Parse(Console.ReadLine());
- int sum = 0;
- if (age >= 0 && age < 123)
- {
- if (day == "Weekday")
- {
- sum = age > 18 && age <= 64 ? 18 : 12;
- }
- else if (day == "Weekend")
- {
- sum = age > 18 && age <= 64 ? 20 : 15;
- }
- else if (day == "Holiday")
- {
- sum = age <= 18 ? 5 : age > 64 ? 10 : 12;
- }
- }
- Console.WriteLine(sum == 0 ? "Error!" : $"{ sum}$");
- }
- }
- }
Add Comment
Please, Sign In to add comment