Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DifferentIntSize
- {
- class Program
- {
- static void Main(string[] args)
- {
- BigInteger inputInt = BigInteger.Parse(Console.ReadLine());
- int check = 0;
- if (inputInt > sbyte.MinValue && inputInt < sbyte.MaxValue)
- {
- check++;
- if (check == 1)
- {
- Console.WriteLine(inputInt + " can fit in:");
- }
- Console.WriteLine("* sbyte");
- }
- if (inputInt > byte.MinValue && inputInt < byte.MaxValue)
- {
- check++;
- if (check == 1)
- {
- Console.WriteLine(inputInt + " can fit in:");
- }
- Console.WriteLine("* byte");
- }
- if (inputInt > short.MinValue && inputInt < short.MaxValue)
- {
- check++;
- if (check == 1)
- {
- Console.WriteLine(inputInt + " can fit in:");
- }
- Console.WriteLine("* short");
- }
- if (inputInt > ushort.MinValue && inputInt < ushort.MaxValue)
- {
- check++;
- if (check == 1)
- {
- Console.WriteLine(inputInt + " can fit in:");
- }
- Console.WriteLine("* ushort");
- }
- if (inputInt > int.MinValue && inputInt < int.MaxValue)
- {
- check++;
- if (check == 1)
- {
- Console.WriteLine(inputInt + " can fit in:");
- }
- Console.WriteLine("* int");
- }
- if (inputInt > uint.MinValue && inputInt < uint.MaxValue)
- {
- check++;
- if (check == 1)
- {
- Console.WriteLine(inputInt + " can fit in:");
- }
- Console.WriteLine("* uint");
- }
- if (inputInt > long.MinValue && inputInt < long.MaxValue)
- {
- check++;
- if (check == 1)
- {
- Console.WriteLine(inputInt + " can fit in:");
- }
- Console.WriteLine("* long");
- }
- // if (inputInt > ulong.MinValue && inputInt < ulong.MaxValue)
- // {
- // check++;
- // if (check == 1)
- // {
- // Console.WriteLine(inputInt + " can fit in:");
- // }
- // Console.WriteLine("* ulong");
- //}
- if (check == 0)
- {
- Console.WriteLine(inputInt + " can't fit in any type");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement