Guest User

Untitled

a guest
Jul 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Revision_01
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. Console.WriteLine("Please enter 3 numbers, One at a time.");
  13.  
  14. int num1 = int.Parse(Console.ReadLine());
  15. int num2 = int.Parse(Console.ReadLine());
  16. int num3 = int.Parse(Console.ReadLine());
  17. int tempNum;
  18.  
  19. tempNum = num1;
  20. num1 = num3;
  21. num3 = tempNum;
  22.  
  23. Console.WriteLine("Here are you numbers in reverse order");
  24. Console.WriteLine(num1);
  25. Console.WriteLine(num2);
  26. Console.WriteLine(num3);
  27.  
  28. Console.WriteLine("Please enter H for high score or L for low score.");
  29. string keyInput = Console.ReadLine();
  30. int highNum = num1;
  31. int lowNum = num1;
  32.  
  33. if (keyInput == "H" || keyInput == "h")
  34. {
  35. if (highNum < num2)
  36. {
  37. highNum = num2;
  38. }
  39. if (highNum < num3)
  40. {
  41. highNum = num3;
  42. }
  43. Console.WriteLine(highNum);
  44. }
  45. if (keyInput == "L" || keyInput == "l")
  46. {
  47. if (lowNum > num2)
  48. {
  49. lowNum = num2;
  50. }
  51. if (lowNum > num3)
  52. {
  53. lowNum = num3;
  54. }
  55. Console.WriteLine(lowNum);
  56. }
  57.  
  58. Console.ReadKey();
  59. }
  60. }
  61. }
Add Comment
Please, Sign In to add comment