Advertisement
SensaBG

CONTAINS

Aug 19th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class test {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. // Does the String contains upper arrow "^"? \\
  8. // INPUTS: OUTPUT \\
  9. //_______________________________________________\\
  10. // dasundai^dnoasd will print YES \\
  11. //___________________________________________________\\
  12. // d,10[387ue891uq10-F%@E%!E! will print NO \\
  13. //_______________________________________________________\\
  14. // ^ will print YES \\
  15. //___________________________________________________________\\
  16.  
  17. String randomString = scanner.nextLine();
  18.  
  19. if(randomString.contains("^")){
  20. System.out.println("YES");
  21. } else {
  22. System.out.println("NO");
  23. }
  24.  
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement