igorich1376

Is_password_good

Aug 23rd, 2024
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.53 KB | None | 0 0
  1. ##
  2. function is_password_good(password: string): boolean;
  3. begin
  4.   var (cnt,sum_совпадений) := (0,0);
  5.   if (Length(password) >= 8) then cnt += 1;
  6.   if (password <> password.ToUpper) then cnt += 1;
  7.   if (password <> password.ToLower) then cnt += 1;
  8.   for var i := 1 to Length(password) do
  9.       if password[i] in '0123456789' then sum_совпадений += 1;
  10.   if sum_совпадений >= 1 then cnt += 1;
  11.   if (cnt = 4) then Result:= true else Result:= false;
  12. end;
  13. //
  14. var txt := ReadString;
  15. Print(is_password_good(txt))
Advertisement
Add Comment
Please, Sign In to add comment