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 ConsoleApp1
- {
- class Program
- {
- static int Func(int n)
- {
- int k = 0;
- if (n % 2 != 0)
- k++;
- if (n / 10 != 0)
- k += Func(n / 10);
- return k;
- }
- static void Main(string[] args)
- {
- Console.Write("A=");
- int A = int.Parse(Console.ReadLine());
- Console.Write("B=");
- int B = int.Parse(Console.ReadLine());
- for (int n = A + 1;; ++n)
- {
- int m = Func(n);
- if (m == B){
- Console.WriteLine("{0}", n);
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement