Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace StringsLesson
- {
- class Program
- {
- static void Main(string[] arg)
- {
- //Console.WriteLine("Не пишiть символ 'p'");
- //string text = Console.ReadLine();
- //int age = int.Parse(Console.ReadLine());
- //Console.WriteLine($"Hello {text} {age}");
- //text = text.ToLower();
- //text = text.Trim();
- //if (text.Equals("BASEfffff"))
- //{
- // Console.WriteLine("ERROR");
- //}
- //if (text.Contains('a') && text.Contains('b'))
- //{
- // Console.WriteLine("ERROR");
- //}
- //text = text.Insert(0, "e");
- //if (text.StartsWith('e'))
- //{
- // Console.WriteLine("Start");
- //}
- //text.EndsWith("apk");
- //text = text.Remove(3);
- //text = text.Replace('b', 'a');
- //char[] bykvi = text.ToCharArray();
- //Console.WriteLine(text);
- //string[] niks = {"UBIycha", "ДРОЖДІ540",
- // "Terminator", "Nahibator", "Visual", ""};
- //string newNik = Console.ReadLine();
- //if (!niks.Contains(newNik))
- //{
- // niks[niks.Length - 1] = newNik;
- // Console.WriteLine("Чудовий нік");
- //}
- //else
- //{
- // Console.WriteLine("Цей нік уже є");
- //}
- //Console.WriteLine("Список усіх ніків");
- //foreach (var nik in niks)
- //{
- // Console.WriteLine(nik);
- //}
- char[] symbols = { 'a', 'b', 'c', 'd', 'e' };
- Random rnd = new Random();
- int lenghtNewNik = int.Parse(Console.ReadLine());
- int lenghtNiks = int.Parse(Console.ReadLine());
- string test = string.Empty;
- int countNiks = 0;
- string[] testNiks = new string[lenghtNiks];
- while (countNiks < lenghtNiks)
- {
- for (int i = 0; i < lenghtNewNik; i++)
- {
- test += symbols[rnd.Next(0, symbols.Length)];
- testNiks[i] = test;
- countNiks++;
- test = string.Empty;
- }
- }
- foreach (var nik in testNiks)
- {
- Console.WriteLine(nik);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment