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