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;
- namespace _4._4
- {
- class Program
- {
- static int QuanOfDel(int a)
- {
- int q = 0;
- for (int i = 1; i <= Math.Sqrt(a); ++i)
- if (a % i == 0)
- if (i * i == a) q++;
- else
- q += 2;
- return q;
- }
- static void Main()
- {
- Console.Write("Введите a: ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("Введите b: ");
- int b = int.Parse(Console.ReadLine());
- Console.Write("Введите K: ");
- int k = int.Parse(Console.ReadLine());
- for (int i = a; i <= b; ++i)
- {
- if (QuanOfDel(i) == k)
- {
- Console.Write("{0} ", i);
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement