Advertisement
CR7CR7

mutantString

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