using System;
using static System.Console;
namespace ConsoleApp11
{
class Program
static int kdel(int n)
int k = 0;
for (int i = 1; i <= n; i++)
if (n % i == 0)
k++;
return k;
}
static void Main(string[] args)
int x, n,a,max,c;
n=int.Parse(ReadLine());
max = 0;
c = 0;
for(int i=1;i<=n;i++)
a = int.Parse(ReadLine());
x = kdel(a);
if (x > max)
max = x;
c = a;
WriteLine(c.ToString());
ReadKey();
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
using System;
using static System.Console;
namespace ConsoleApp11
{
class Program
{
static int kdel(int n)
{
int k = 0;
for (int i = 1; i <= n; i++)
if (n % i == 0)
k++;
return k;
}
static void Main(string[] args)
{
int x, n,a,max,c;
n=int.Parse(ReadLine());
max = 0;
c = 0;
for(int i=1;i<=n;i++)
{
a = int.Parse(ReadLine());
x = kdel(a);
if (x > max)
{
max = x;
c = a;
}
}
WriteLine(c.ToString());
ReadKey();
}
}
}