Advertisement
Sim0o0na

Untitled

Jun 29th, 2017
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace _06
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. string m = Console.ReadLine();
  11. string n = Console.ReadLine();
  12. string l = Console.ReadLine();
  13. string mnlstring = m + n + l;
  14. int mnl = int.Parse(mnlstring);
  15. int SpecialNumber = int.Parse(Console.ReadLine());
  16. int ControlNumber = int.Parse(Console.ReadLine());
  17.  
  18.  
  19. for (int i = mnl; i >= 111; i--)
  20. {
  21. if (i % 3 == 0)
  22. {
  23. SpecialNumber += 5;
  24. }
  25. else if (i % 10 == 5)
  26. {
  27. SpecialNumber = SpecialNumber - 2;
  28. }
  29. else if (i % 2 == 0)
  30. {
  31. SpecialNumber=SpecialNumber * 2;
  32. }
  33. if (SpecialNumber >= ControlNumber)
  34. {
  35. break;
  36. }
  37.  
  38. }
  39. if (SpecialNumber >= ControlNumber)
  40. {
  41. Console.WriteLine($"Yes! Control number was reached! Current special number is {SpecialNumber}.");
  42. }
  43. else Console.WriteLine($"No! {SpecialNumber} is the last reached special number.");
  44.  
  45.  
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement