o_ignatov

more_exercises_01

Jun 2nd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace TypeBoundaries
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string type = Console.ReadLine();
  14. switch (type)
  15. {
  16. case "int":
  17. Console.WriteLine(int.MaxValue);
  18. Console.WriteLine(int.MinValue);
  19. break;
  20. case "uint":
  21. Console.WriteLine(uint.MaxValue);
  22. Console.WriteLine(uint.MinValue);
  23. break;
  24. case "long":
  25. Console.WriteLine(long.MaxValue);
  26. Console.WriteLine(long.MinValue);
  27. break;
  28. case "byte":
  29. Console.WriteLine(byte.MaxValue);
  30. Console.WriteLine(byte.MinValue);
  31. break;
  32. case "sbyte":
  33. Console.WriteLine(sbyte.MaxValue);
  34. Console.WriteLine(sbyte.MinValue);
  35. break;
  36. default:
  37. break;
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment