Advertisement
Guest User

03. Slot Machine

a guest
Jul 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03.Slot_Machine
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. char firstSymbol = char.Parse(Console.ReadLine());
  10. int firstNum = int.Parse(Console.ReadLine());
  11. char secondSymbol = char.Parse(Console.ReadLine());
  12. int secondNum = int.Parse(Console.ReadLine());
  13. char thirdSymbol = char.Parse(Console.ReadLine());
  14. int thirdNum = int.Parse(Console.ReadLine());
  15.  
  16.  
  17. int firstSumAsciiValue = firstSymbol + firstNum;
  18. int secondSumAsciiValue = secondSymbol + secondNum;
  19. int thirdSumAsciiValue = thirdSymbol + thirdNum;
  20.  
  21. char first = (char)firstSumAsciiValue;
  22. char second = (char)secondSumAsciiValue;
  23. char third = (char)thirdSumAsciiValue;
  24.  
  25. string result = first.ToString() + second.ToString() + third.ToString();
  26. if (result == "@@@")
  27. {
  28. Console.WriteLine("@@@");
  29. Console.WriteLine($"!!! YOU LOSE EVERYTHING !!!");
  30. }
  31. else if (result == "777")
  32. {
  33. Console.WriteLine("777");
  34. Console.WriteLine($"*** JACKPOT ***");
  35. }
  36. else
  37. Console.WriteLine($"{first}{second}{third}");
  38.  
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement