Random rnd = new Random();
Console.Write("N = ");
int N = int.Parse(Console.ReadLine());
int K = 0;
List<int> mas = new List<int>(N);
for(int i = 0;i < N;i++)
{
mas.Add(rnd.Next(0, 10));
}
foreach (int i in mas)
Console.Write(i + " ");
Console.Write("\nK = ");
K = int.Parse(Console.ReadLine());
if (K >= 1 && K <= N)
mas.RemoveAt(K - 1);
Console.ReadKey();
python
import string
lower = list(string.ascii_lowercase)
upper = list(string.ascii_uppercase)
digits = ['0','1','2','3','4','5','6','7','8','9']
characters = ['@', '#', '%', '&']
password = input('Введите пароль: ')
password_difficulty = 0
for i in lower:
if i in password:
password_difficulty += 1
break
for i in upper:
for i in digits:
for i in characters:
print(f'Сложность пароля: {password_difficulty}')
Random rnd = new Random();
Console.Write("N = ");
int N = int.Parse(Console.ReadLine());
int K = 0;
List<int> mas = new List<int>(N);
for(int i = 0;i < N;i++)
{
mas.Add(rnd.Next(0, 10));
}
foreach (int i in mas)
{
Console.Write(i + " ");
}
Console.Write("\nK = ");
K = int.Parse(Console.ReadLine());
if (K >= 1 && K <= N)
{
mas.RemoveAt(K - 1);
foreach (int i in mas)
{
Console.Write(i + " ");
}
}
Console.ReadKey();
python
import string
lower = list(string.ascii_lowercase)
upper = list(string.ascii_uppercase)
digits = ['0','1','2','3','4','5','6','7','8','9']
characters = ['@', '#', '%', '&']
password = input('Введите пароль: ')
password_difficulty = 0
for i in lower:
if i in password:
password_difficulty += 1
break
for i in upper:
if i in password:
password_difficulty += 1
break
for i in digits:
if i in password:
password_difficulty += 1
break
for i in characters:
if i in password:
password_difficulty += 1
break
print(f'Сложность пароля: {password_difficulty}')