Advertisement
spasnikolov131

Untitled

Feb 4th, 2023
29
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. }
  18. static void GetMax(string value1, char value2, char value3)
  19. {
  20. if (value1 == "char")
  21. {
  22. if (Convert.ToChar(value2) > Convert.ToChar(value3))
  23. {
  24. Console.WriteLine(value2);
  25. }
  26. else
  27. {
  28. Console.WriteLine(value3);
  29. }
  30. }
  31. }
  32. static void GetMax(string value1, int value2, int value3)
  33. {
  34. if (value1 == "int")
  35. {
  36. if (Convert.ToInt16(value2) > Convert.ToInt16(value3))
  37. {
  38. Console.WriteLine(value2);
  39. }
  40. else
  41. {
  42. Console.WriteLine(value3);
  43. }
  44. }
  45. }
  46. static void GetMax(string value1, string value2, string value3)
  47. {
  48. if (value1 == "string")
  49. {
  50. if (value2 == value3)
  51. {
  52. Console.WriteLine(value2);
  53. }
  54. else
  55. {
  56. Console.WriteLine(value3);
  57. }
  58. }
  59. }
  60. }
  61. }
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement