Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- string K = Console.ReadLine();
- int num = Convert.ToInt32(K);
- bool found = false;
- do
- {
- num = Convert.ToInt32(K);
- num++;
- K = Convert.ToString(num);
- if (K.Contains("7") || K.Contains("8") || K.Contains("9"))
- {
- num = Convert.ToInt32(K);
- num++;
- }
- else
- {
- num = Convert.ToInt32(K);
- found = true;
- }
- } while (found == false);
- Console.WriteLine(num);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement