Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CathcTheThief
- {
- class Program
- {
- static void Main(string[] args)
- {
- var str = Console.ReadLine();
- byte count = byte.Parse(Console.ReadLine());
- long max = 0;
- switch (str)
- {
- case "sbyte":
- max = sbyte.MaxValue;
- break;
- case "int":
- max = int.MaxValue;
- break;
- case "long":
- max = long.MaxValue;
- break;
- }
- long idThief = long.MinValue;
- for (int i = 0; i < count; i++)
- {
- long idCurrent = long.Parse(Console.ReadLine());
- if (idCurrent > idThief && idCurrent <= max)
- {
- idThief = idCurrent;
- }
- }
- Console.WriteLine(idThief);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement