fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Set<String> cities = new HashSet<String>(Arrays.asList(new String[] {
  9. "Judenburg", "Knittelfeld", "Zeltweg", "Leoben", "Bruck/Mur", "Kapfenberg"
  10. }));
  11. if (cities.contains("Knittelfeld")) {
  12. System.out.println("Knittelfeld: yes");
  13. }
  14. if (!cities.contains("Moscow")) {
  15. System.out.println("Moscow: no");
  16. }
  17.  
  18. }
  19. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Knittelfeld: yes
Moscow: no