Advertisement
vov44k

Untitled

Apr 25th, 2022
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner in = new Scanner(System.in);
  7.  
  8.         String s = in.nextLine();
  9.         int countBig = 0;
  10.         int countSmall = 0;
  11.         int countDigit = 0;
  12.  
  13.         if (s.length() < 8)
  14.             System.out.print("NO");
  15.         else {
  16.             for (int i = 0; i < s.length(); i++) {
  17.                 if (Character.isLetter(s.charAt(i)))
  18.                 {
  19.                     if (Character.isUpperCase(s.charAt(i)))
  20.                         countBig++;
  21.                     else
  22.                         countSmall++;
  23.                 }
  24.                 if (Character.isDigit(s.charAt(i)))
  25.                     countDigit++;
  26.             }
  27.             if (countBig > 0 && countSmall > 0 && countDigit > 0)
  28.                 System.out.print("YES");
  29.             else
  30.                 System.out.print("NO");
  31.         }
  32.         in.close();
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement