Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace One
- {
- class Program
- {
- static void Main(string[] args)
- {
- var gender = Console.ReadLine().ToLower();
- int age = int.Parse(Console.ReadLine());
- int staj = int.Parse(Console.ReadLine());
- int diffmen = Math.Abs(staj - 38);
- int diffwoman = Math.Abs(staj - 38);
- int diffagemen = Math.Abs(age - 64);
- int diffagewoman = Math.Abs(age - 64);
- if (gender == "male" || gender == "female")
- {
- if (age > 1 && age < 10000)
- {
- if (staj > 1 && staj < 10000)
- {
- if (gender == "male")
- {
- if (age >= 64 && staj >= 38)
- Console.WriteLine("Ready to retire at {0} and {1} years of experience!", age, staj);
- else if (age >= 64 && staj < 38)
- Console.WriteLine("Old enough, but haven't worked enough. Work experience left to retirement: {0}.", diffmen);
- else if (age < 64 && staj >= 38)
- Console.WriteLine("Worked enough, but not old enough. Years left to retirement: {0}.", diffagemen);
- else if (age < 64 && staj < 38)
- Console.WriteLine("Too early. Years left to retirement: {0}. Work experience left to retirement: {1}.", diffagemen, diffmen);
- }
- else if (gender == "female")
- {
- if (age >= 31 && staj >= 35)
- Console.WriteLine("Ready to retire at {0} and {1} years of experience!", age, staj);
- else if (age >= 61 && staj < 35)
- Console.WriteLine("Old enough, but haven't worked enough. Work experience left to retirement: {0}.", diffwoman);
- else if (age < 61 && staj >= 35)
- Console.WriteLine("Worked enough, but not old enough. Years left to retirement: {0}.", diffagewoman);
- else if (age < 61 && staj < 35)
- Console.WriteLine("Too early. Years left to retirement: {0}. Work experience left to retirement: {1}.", diffagewoman, diffwoman);
- }
- }
- else
- Console.WriteLine("Invalid input.");
- }
- else
- Console.WriteLine("Invalid input.");
- }
- else
- Console.WriteLine("Invalid input.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement