Advertisement
urksiful

ACM UML Contest View 02

Nov 19th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4. Sorry for the fail, I put the paste in pastebin wheter check that i loggued in
  5. my account, sorry for the inconvenence and enjoy for the code!
  6.  
  7. Greeatings!
  8. */
  9. public class AllinAll {
  10.  
  11. public static void main(String[] args) {
  12. Scanner x = new Scanner(System.in);
  13. String key;
  14. String enc;
  15. int ci=0;
  16.  
  17. do{
  18. key = x.next();
  19. enc = x.next();
  20.  
  21. int lop=0, trip=0;
  22. while(lop<key.length()){
  23.  
  24. if(enc.contains(key.substring(lop, lop+1))){
  25. enc = enc.substring(enc.indexOf(key.charAt(lop)));
  26. trip++;
  27. }
  28. lop++;
  29. }
  30. if(trip == key.length()){
  31. System.out.println("Yes");
  32. }else{
  33. System.out.println("No");
  34. }
  35.  
  36. ci++;
  37. }while(ci<20);
  38.  
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement