Advertisement
svetoslavhl

Sevenland

Mar 4th, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8.  
  9. string K = Console.ReadLine();
  10. int num = Convert.ToInt32(K);
  11.  
  12. bool found = false;
  13. do
  14. {
  15. num = Convert.ToInt32(K);
  16. num++;
  17. K = Convert.ToString(num);
  18. if (K.Contains("7") || K.Contains("8") || K.Contains("9"))
  19. {
  20. num = Convert.ToInt32(K);
  21. num++;
  22.  
  23. }
  24. else
  25. {
  26. num = Convert.ToInt32(K);
  27. found = true;
  28.  
  29. }
  30.  
  31.  
  32. } while (found == false);
  33.  
  34. Console.WriteLine(num);
  35.  
  36.  
  37.  
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement