Bob103

C#_2(HW_VII_6)

Sep 22nd, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Diagnostics;
  7.  
  8. namespace ConsoleApplication1
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Console.Write("Введите a=");
  15.             int a = Convert.ToInt32(Console.ReadLine());
  16.             Console.Write("Введите b=");
  17.             int b= Convert.ToInt32(Console.ReadLine());
  18.  
  19.             Console.Write("Введите c=");
  20.             int c = Convert.ToInt32(Console.ReadLine());
  21.             for (int i = a; i <= b; i++)
  22.             {
  23.                 int n = i;
  24.                 while (n != 0)
  25.                 {
  26.                     if (n % 10 == c)
  27.                     {
  28.                         Console.WriteLine(i);
  29.                         break;
  30.                     }
  31.                     n /= 10;
  32.                 }
  33.             }
  34.         }
  35.  
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment