CS
cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
using System.Text.RegularExpressions;
class MainClass {
static string Validate(string pass)
{
Regex chars = new Regex(@".*[#$*%@&!]{2,}.*");
Regex num = new Regex(@".*\d{2,}.*");
if (num.IsMatch(pass) && chars.IsMatch(pass) && pass.Length >= 7)
{
return "Strong";
}
return "Weak";
}
public static void Main (string[] args)
{
Console.WriteLine(Validate(Console.ReadLine()));
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run