// C# 7.3
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
var crypted = "";
for (int i = 0; i < CaesarCipher.Ru.Length; i++)
Console.WriteLine(CaesarCipher.Decode(i, crypted));
}
}
class CaesarCipher
{
public static readonly string Ru = "";
public static readonly string RuD = "";
private static readonly int defaultStep = 3;
public static CaesarEncrypted Encode(int step, string source, Func<string, string> translate)
{
string translatedData = translate(source);
var stringBuilder = new StringBuilder();
foreach (char c in translatedData.ToLower())
{
stringBuilder.Append(RuD[Ru.IndexOf(c) + step]);
}
return new CaesarEncrypted(step, stringBuilder.ToString());
}
public static CaesarEncrypted Encode(int step, string source)
{
return Encode(step, source, x => x);
}
public static string Decode(CaesarEncrypted source)
{
var step = source.Step;
return Encode(-step + Ru.Length, source.ToString(), x => x);
}
public static string Decode(int step, string source)
{
return Encode(-step + Ru.Length, source, x => x);
}
}
class CaesarEncrypted : IEnumerable, IEnumerable<char>
{
public int Step { get; set; }
public string Data { get; set; }
public CaesarEncrypted(int step, string initData)
{
Step = step;
Data = initData;
}
public CaesarEncrypted(string initData) : this(int.MaxValue, initData)
{}
public IEnumerator<char> GetEnumerator()
{
foreach (char c in Data)
yield return c;
}
IEnumerator IEnumerable.GetEnumerator() => (IEnumerator<char>)GetEnumerator();
public override string ToString() => Data;
public static implicit operator string(CaesarEncrypted source) => source.ToString();
}
}
const
handsfree = false;
nmax = 10;
random_min = -50;
random_max = 50;
var
a: array[0..nmax] of real;
i, n: integer;
sum, x: real;
begin
{ввод массива}
n := nmax;
if handsfree then begin
for i := 0 to n do
begin
a[i] := random(random_max - random_min) + random_min;
write(a[i], ' ');
end
end
else begin
for i := 0 to n do
readln(a[i]);
end;
writeln();
{подсчет суммы}
write('x = ');
readln(x);
sum := a[n];
for i := n - 1 downto 0 do
sum := sum * x + a[i];
writeln('S = ', sqrt(sum));
end.
2525 Может
256 не может, т.к. порядок это означает, что сумма трёх цифр -56, а это невозможно
2520 порядок не тот
2528 сумма трёх цифр не может быть 28
2825 порядок не тот
2025 может
625 может
106 порядок не тот
ответ: 3