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 ConsoleApplication19
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num, dig, original, numdig;
- bool a = false;
- Console.WriteLine("Please enter a number: ");
- num = int.Parse(Console.ReadLine());
- Console.WriteLine("Please enter one digit: ");
- dig = int.Parse(Console.ReadLine());
- original = num;
- while (num > 0 && a == false)
- {
- numdig = num % 10;
- num /= 10;
- if (numdig == dig)
- a = true;
- }
- if (a == true)
- Console.WriteLine((original * 10 + dig));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement