Вводите путь к файлу, кол-во букв и цифр будет в консоли и в конце файла
using System;
using System.IO;
using System.Text;
namespace Program
{
class Program
{
static void Main(string[] args)
{
string inputFilePath = Console.ReadLine();
string inputStr = File.ReadAllText(inputFilePath);
int letters = 0, digits = 0;
foreach (var s in inputStr)
{
if (char.IsLetter(s))
++letters;
else if (char.IsDigit(s))
++digits;
}
File.AppendAllText(inputFilePath, $"Letters: {letters}, Digits: {digits}");
Console.WriteLine($"Letters: {letters}\n\rDigits: {digits}\n\r");
Console.ReadKey();
}
}
}
Вот вариант на Паскале
var a, nn, i, max, maxi : integer;
BEGIN
read(nn); max := 0; maxi := 0;
for i := 1 to nn do begin
read(a);
if abs(a) >= abs(max) then begin
max := a; maxi := i;
end;
end;
write(maxi);
END.