题目描述:
s01串初始为" 0"
按以下方式变换
0变1,1变01
代码:
public class Main {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int n = scanner.nextInt();String str = "0";for (int i = 0; i < n; i++) {str = str.replace("0","a");str = str.replace("1","01");str = str.replace("a","1");}System.out.println(str);}
}