Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication21
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num, dig, original,numdig;
- Console.WriteLine("Please enter a number: ");
- num = int.Parse(Console.ReadLine());
- Console.WriteLine("Please enter one digit: ");
- dig = int.Parse(Console.ReadLine());
- original = num;
- numdig = dig + 1;
- while (num > 0 && numdig != dig)
- {
- numdig = num % 10;
- num /= 10;
- }
- if (numdig != dig)
- Console.WriteLine((original / 10 * 10 + dig));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement