Abdula_2314124

Untitled

Mar 24th, 2024
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.54 KB | None | 0 0
  1. namespace StringsLesson
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] arg)
  6.         {
  7.             //Console.WriteLine("Не пишiть символ 'p'");
  8.             //string text = Console.ReadLine();
  9.             //int age = int.Parse(Console.ReadLine());
  10.  
  11.             //Console.WriteLine($"Hello {text} {age}");
  12.             //text = text.ToLower();
  13.             //text = text.Trim();
  14.  
  15.             //if (text.Equals("BASEfffff"))
  16.             //{
  17.             //    Console.WriteLine("ERROR");
  18.             //}
  19.  
  20.             //if (text.Contains('a') && text.Contains('b'))
  21.             //{
  22.             //    Console.WriteLine("ERROR");
  23.             //}
  24.             //text = text.Insert(0, "e");
  25.             //if (text.StartsWith('e'))
  26.             //{
  27.             //    Console.WriteLine("Start");
  28.             //}
  29.             //text.EndsWith("apk");
  30.             //text = text.Remove(3);
  31.             //text = text.Replace('b', 'a');
  32.             //char[] bykvi = text.ToCharArray();
  33.  
  34.             //Console.WriteLine(text);
  35.  
  36.             //string[] niks = {"UBIycha", "ДРОЖДІ540",
  37.             //    "Terminator", "Nahibator", "Visual", ""};
  38.  
  39.             //string newNik = Console.ReadLine();
  40.             //if (!niks.Contains(newNik))
  41.             //{
  42.             //    niks[niks.Length - 1] = newNik;
  43.             //    Console.WriteLine("Чудовий нік");
  44.             //}
  45.             //else
  46.             //{
  47.             //    Console.WriteLine("Цей нік уже є");
  48.             //}
  49.  
  50.             //Console.WriteLine("Список усіх ніків");
  51.             //foreach (var nik in niks)
  52.             //{
  53.             //    Console.WriteLine(nik);
  54.             //}
  55.  
  56.             char[] symbols = { 'a', 'b', 'c', 'd', 'e' };
  57.             Random rnd = new Random();
  58.             int lenghtNewNik = int.Parse(Console.ReadLine());
  59.             int lenghtNiks = int.Parse(Console.ReadLine());
  60.             string test = string.Empty;
  61.             int countNiks = 0;
  62.             string[] testNiks = new string[lenghtNiks];
  63.             while (countNiks < lenghtNiks)
  64.             {
  65.                 for (int i = 0; i < lenghtNewNik; i++)
  66.                 {
  67.                     test += symbols[rnd.Next(0, symbols.Length)];
  68.                     testNiks[i] = test;
  69.                     countNiks++;
  70.                     test = string.Empty;
  71.                 }
  72.             }
  73.  
  74.             foreach (var nik in testNiks)
  75.             {
  76.                 Console.WriteLine(nik);
  77.             }
  78.            
  79.         }
  80.     }
  81. }
  82.  
Advertisement
Add Comment
Please, Sign In to add comment