bonusFunction b = Bonus.Kattenacho;
Type methodHost = b.Method.DeclaringType;
string methodName = b.Method.Name;
Console.WriteLine("{0} -> {1}", methodHost.FullName, methodName);
private static readonly Encoding Windows1251Encoding = Encoding.GetEncoding(1251);
static string FromCyrillicStringArray(string[] values)
{
var bytes = new byte[values.Length];
for (var i = 0; i < values.Length; i++)
bytes[i] = Convert.ToByte(values[i]);
return Windows1251Encoding.GetString(bytes);
}
...
var codes = new[] { "207", "192", "207", "192" };
Console.WriteLine(FromCyrillicStringArray(codes) == "ПАПА"); // true
static bool TryGetCharIndices(char element, out int x, out int y)
{
for (var i = 0; i < URusa2.GetLength(0); i++)
{
for (var j = 0; j < URusa2.GetLength(1); j++)
{
if (URusa2[i, j] == element)
{
y = i;
x = j;
return true;
}
}
}
x = -1;
y = -1;
return false;
}
pole_zapol(null, null);
var classes = new[]
{
new
{
Name = "System.String",
AssemblyName = "mscorlib",
Args = new object[] { "Single argument".ToCharArray() }
},
new
{
Name = "Newtonsoft.Json.Linq.JObject",
AssemblyName = "Newtonsoft.Json",
Args = new object[] {}
},
new
{
Name = "System.IO.FileInfo",
AssemblyName = "mscorlib",
Args = new object[] { @"C:\Windows\System32\cmd.exe" }
}
};
var instances = classes
.Select(i =>
{
var assembly = Assembly.Load(i.AssemblyName);
var type = assembly.GetType(i.Name);
var instance = Activator.CreateInstance(type, i.Args);
return instance;
})
.ToArray();
class Program
{
static void Main(string[] args)
{
Console.InputEncoding = Console.OutputEncoding = Encoding.GetEncoding(@"Cyrillic");
var letters = Console.ReadLine().ToCharArray(); // Введи весь алфавит в одну строчку
var wordLength = int.Parse(Console.ReadLine()); // Введи размер слова
var word = new char[wordLength];
var totalWordsCount = 1;
for (var i = 0; i < wordLength; i++)
totalWordsCount *= letters.Length;
for (var i = 0; i < totalWordsCount; i++)
{
var accum = i;
for (var j = word.Length - 1; j >= 0; j--)
{
word[j] = letters[accum % letters.Length];
accum /= letters.Length;
}
Console.WriteLine(new string(word));
}
Console.ReadKey();
}
}