解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String a = "0"; while (n > 0) { String b = ""; for (int i = 0; i < a.length(); i++) { if (a.charAt(i) == '0') b += "1"; else if (a.charAt(i) == '1') b += "01"; } a = b; n--; } System.out.println(a); } }
0.0分
0 人评分