Advertisement
CR7CR7

Mutant-String

Sep 19th, 2022
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import java.util.Objects;
  2. import java.util.Scanner;
  3.  
  4. public class Test {
  5.  
  6. public static void main(String[] args) {
  7.  
  8. Scanner scan = new Scanner(System.in);
  9. String str1 =scan.nextLine();
  10. String str2 = scan.nextLine();
  11.  
  12. String m_str = " ";
  13. for(int i=0;i<str1.length();i++){
  14.  
  15. String f_str =str1.substring(i);
  16. m_str =str2.substring(0,i) + f_str;
  17. if (!str1.equals(str2)){
  18. System.out.println(m_str);
  19.  
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement