23 lines
635 B
C#
23 lines
635 B
C#
|
using System;
|
|||
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
class Program
|
|||
|
{
|
|||
|
static void Main()
|
|||
|
{
|
|||
|
string inputFile = "/var/data/data.txt";
|
|||
|
string outputFile = "/var/result/result.txt";
|
|||
|
|
|||
|
string[] lines = File.ReadAllLines(inputFile);
|
|||
|
int[] numbers = lines.Select(int.Parse).ToArray();
|
|||
|
|
|||
|
int minNumber = numbers.Min();
|
|||
|
int countOfMinNumbers = numbers.Count(n => n == minNumber);
|
|||
|
|
|||
|
File.WriteAllText(outputFile, countOfMinNumbers.ToString());
|
|||
|
|
|||
|
Console.WriteLine("Количество наименьших чисел сохранено в файле: " + outputFile);
|
|||
|
}
|
|||
|
}
|