using System;
using System.Linq;
public class Program
{
public static string GenerateRandomPassword(int length) {
string chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%&";
Random rnd = new Random();
return new string(Enumerable.Repeat(chars, length)
.Select(s => s[rnd.Next(s.Length)]).ToArray());
}
public static void Main()
{
int length = 7;
string password = GenerateRandomPassword(length);
Console.WriteLine(password);
}
}
/*
run:
@%un917
*/