fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Pangrams {
  9.  
  10. public static void main(String[] args) {
  11.  
  12. Scanner sc = new Scanner(System.in);
  13. String s = sc.nextLine();
  14. s = s.toLowerCase();
  15. HashSet<Integer> h = new HashSet<>();
  16. for (int i = 0; i < s.length(); i++) {
  17. if (s.charAt(i) != ' ') {
  18. int put = (int) s.charAt(i);
  19. h.add(put);
  20. }
  21. }
  22. if (h.size() == 26)
  23. System.out.println("pangram");
  24. else
  25. System.out.println("not pangram");
  26. }
  27. }
Success #stdin #stdout 0.05s 4386816KB
stdin
The quick brown fox jumps over the lazy little dog
stdout
pangram