Advertisement
spasnikolov131

Untitled

Feb 4th, 2023
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. using System;
  2. using System.Reflection.Metadata.Ecma335;
  3.  
  4. namespace Greater_of_Two_Values2
  5. {
  6. internal class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10.  
  11.  
  12. string value1 = Console.ReadLine();
  13. string value2 = Console.ReadLine();
  14. string value3 = Console.ReadLine();
  15. GetMax(value1, value2, value3);
  16. }
  17. static void GetMax(string value1, char value2, char value3)
  18. {
  19. if (value1 == "char")
  20. {
  21. if (Convert.ToChar(value2) > Convert.ToChar(value3))
  22. {
  23. Console.WriteLine(value2);
  24. }
  25. else
  26. {
  27. Console.WriteLine(value3);
  28. }
  29. }
  30. }
  31. static void GetMax(string value1, int value2, int value3)
  32. {
  33. if (value1 == "int")
  34. {
  35. if (Convert.ToInt16(value2) > Convert.ToInt16(value3))
  36. {
  37. Console.WriteLine(value2);
  38. }
  39. else
  40. {
  41. Console.WriteLine(value3);
  42. }
  43. }
  44. }
  45. static void GetMax(string value1, string value2, string value3)
  46. {
  47. if (value1 == "string")
  48. {
  49. if (value2 == value3)
  50. {
  51. Console.WriteLine(value2);
  52. }
  53. else
  54. {
  55. Console.WriteLine(value3);
  56. }
  57. }
  58. }
  59. }
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement