Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Task01
- {
- class Program
- {
- static void Main(string[] args)
- {
- String EGN = Console.ReadLine();
- int year = int.Parse(EGN.Substring(0, 2));
- int month = int.Parse(EGN.Substring(2, 2));
- if (month > 20 && month <= 32)
- {
- year += 1800;
- }
- else if (month > 40 && month <= 52)
- {
- year += 2000;
- }
- else
- {
- year += 1900;
- }
- int age = 2019 - year;
- if (age >= 18)
- {
- Console.WriteLine("adult");
- }
- else
- {
- Console.WriteLine("juvenile");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement