Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] a = Console.ReadLine().Split(' ');
- long start = long.Parse(a[0]);
- long end = long.Parse(a[1]);
- int counter = 0;
- for (int i = 1; i < 10; i++)
- {
- int startPoint = i;
- long current = i;
- for (long j = 0; j < 18; j++)
- {
- if ((current >= start) && (current <= end))
- {
- counter++;
- current = current * 10 + startPoint;
- }
- else
- break;
- }
- }
- Console.WriteLine(counter);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement