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 ConsoleApplication1
- {
- class Program
- {
- static int TheNumberOfDivisios(int n)
- {
- if (n == 1)
- return 1;
- else
- {
- int k = 2;
- for (int i = 2; i <= n / 2; i++)
- {
- if (n % i == 0) k++;
- }
- return k;
- }
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Enter a: ");
- int a = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter b: ");
- int b = int.Parse(Console.ReadLine());
- if(TheNumberOfDivisios(a) > TheNumberOfDivisios(b))
- Console.WriteLine("The number of divisios more in a ({0}) then b ({1})", TheNumberOfDivisios(a), TheNumberOfDivisios(b));
- else Console.WriteLine("The number of divisios more in b then a");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment